MongoDB
 sql >> Database >  >> NoSQL >> MongoDB

Modifica del database mongo

Dal driver MongoDB 2.0.0 docs

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();

});