Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
quick node.acs mongodb connection
var host=""; // replace with your MongoDB server address
var port="29328";// Replace with your MongoDB server port
var server_options=""
var mongodb = require("mongodb"),
mongoserver = new mongodb.Server(host, port),
db_connector = new mongodb.Db('|| ENTER MONGODB DB NAME ||', mongoserver,{w:0});, myDB) {
if (!err) {
// work with database
} else {
// handle error
console.log('connection error');
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.