1.

How to create a collection in MongoDB and example with parameter?

Answer»

How to create a collection in MongoDB and example with parameter?
In MongoDB we use db.createCollection(NAME, options) to create collection. And below is the SYNTAX to create collection in MongoDB with some parameter list.

db.createCollection(name, options)

In above command we have two parameter name and options. Here Name is name of collection which we create. And now second parameter Options which is DOCUMENT which is used to specify CONFIGURATION of collection.


In second parameter options we have list of below given options



Discussion

No Comment Found