MongoDB2.0.0ドライバーから
var mongodb = require('mongodb');
var MongoClient = mongodb.MongoClient;
var url = "mongodb://user:[email protected],db2,db3/foo?authSource=admin";
MongoClient.connect(url, function(err, db) {
console.log("Connected correctly to server");
console.log("Current database", db.databaseName);
//db==foo
db.close();
});