Skip to content

Instantly share code, notes, and snippets.

View chrisbrocklesby's full-sized avatar
💭
☕️

Chris Brocklesby chrisbrocklesby

💭
☕️
View GitHub Profile
@chrisbrocklesby
chrisbrocklesby / MongoDB_Native.md
Created August 29, 2021 02:00
MongoDB Native Drive Example - (NodeJS / Export & Import / Await & Async)

MongoDB Native Drive Example

(NodeJS / Export & Import / Await & Async)

db.js

const mongodb = require('mongodb');

const url = 'CONNECTION_URL';
const options = {};
const database = 'DATABASE_NAME';
@runemadsen
runemadsen / app.rb
Created September 28, 2012 01:09
Creating a blog in Sinatra and Datamapper
require 'sinatra'
require 'dm-core'
DataMapper::setup(:default, {:adapter => 'yaml', :path => 'db'})
class BlogPost
include DataMapper::Resource
property :id, Serial
property :title, String
property :body, Text