Creating Collections

You have already seen the process of creating a collection. You simply use the createCollection() method on the Db object. For example:

var newDB = db.db("newDB");
newDB.createCollection("newCollection", function(err, collection){ }

The value of the collection parameter of the callback is a Collection object. You can use this object to manipulate the collection, add documents, etc.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.163.127