title: Drop multiple Mongo Databases using the Node JS Driver
body: <p>I am able to dropDatabase using the Node JS Driver <a href="http://mongodb.github.io/node-mongodb-native/2.0/api/Db.html#dropDatabase" rel="nofollow">Db class Method dropDatabase</a>. </p>
  
  <p>But the problem is, I have to connect to the Database before dropping it as follows:</p>
  
  <pre><code>var MongoClient = require('mongodb').MongoClient;
  var databaseName = 'myMongoDatabaseName'
  var connStr = 'mongodb://localhost:27017/' + databaseName;
  
  MongoClient.connect(connStr, function(err, db) {
      // Let's drop the database
      db.dropDatabase(function(err, result) {  
          console.dir('we dropped the database ');
      });
      db.close();
  });
  </code></pre>
  
  <p>I am able to list all the databases in the MongoDb, just connecting to the root as follows: </p>
  
  <pre><code>var MongoClient = require('mongodb').MongoClient;
  MongoClient.connect('mongodb://localhost:27017/', function(err, db) {
      db.admin().listDatabases().then(function(dbs) {
          // Grab the databases
          dbs = dbs.databases;
          for(var i = 0; i &lt; dbs.length; i++) {
              console.dir(dbs[i].name);
          }
          db.close();
      });
  });         
  </code></pre>
  
  <p>My question is, if I have 10 databases, then every time I have to connect to database and drop it (repeat for 10 databases)? </p>
  
  <p>Is their any way like, connect to root (without specifying any database Name) and drop the database using the specific Database Name?  </p>