MongoLab config in nodejs
var mongo = require('mongodb'),
Server = mongo.Server,
Db = mongo.Db,
server = new Server('ds1234.mongolab.com', 12345, { auto_reconnect : true }),
db = new Db('db-name', server);
db.open(function(err, client) {
client.authenticate('username', 'password', function(err, success) {
// Do Something ...
});
});
Written by Vitor Leal
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Mongodb
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#