title: Changing mongo database
body: <p>I want to query a collection in my replica set using the native 2.0 mongodb driver for node. I can connect and authenticated against the <code>admin</code> database but how do I switch databases to query the collection I'm interested in?</p>
  
  <pre><code>var mongodb  = require('mongodb');
  var MongoClient = mongodb.MongoClient;
  
  var url = "mongodb://user:pass@db1,db2,db3/admin";
  
  MongoClient.connect(url, function(err, db) {
  
      console.log("Connected correctly to server");
      console.log("Current database", db.databaseName);
  
      // switch context to database foo
      // foo.bar.findOne();
  
      db.close();
  
  });
  </code></pre>