Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Mongo Client Example
var MongoClient = require('mongodb').MongoClient;
var mongo_url = "mongodb://localhost:27017/mydbname"
MongoClient.connect(settings.application_settings.mongo_url, function(err, db_client) {
var mongo_collection = db_client.collection("a_collection_name");
// Insert empty object { } or whatever you want
mongo_collection.insert({ }, function(err, result) {
// handle err and result
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.