var MongoClient = require('mongodb').MongoClient;
MongoClient.connect("mongodb://localhost/", function(err, db) {
  var newDB = db.db("newDB");
  newDB.collectionNames(function(err, collectionNames){
    console.log("Początkowe kolekcje: ");
    console.log(collectionNames);
    newDB.createCollection("newCollection", function(err, collection){
      newDB.collectionNames(function(err, collectionNames){
        console.log("Kolekcje po operacji tworzenia: ");
        console.log(collectionNames);
        newDB.dropCollection("newCollection", function(err, results){
          newDB.collectionNames(function(err, collectionNames){
            console.log("Kolekcje po operacji usuwania: ");
            console.log(collectionNames);
            db.close();
          });
        });
      });
    });
  });
});
