Write the syntax for creating a collection and dropping a collection in MongoDB.

devquora
devquora

Posted On: Mar 27, 2020

 

The creation of the collection is the basic step in MongoDB. Here is the syntax for creating a collection in MongoDB-

 Db.createCollection (name, options)

Dropping a collection basically means deleting a collection. Following is the syntax for dropping a collection in MongoDB-

Db.collection.drop()

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    MongoDB Interview Questions

    What do you know about MongoDB?

    MongoDB is a cross-platform document-oriented database program which is open source and free in nature. It can also be..

    MongoDB Interview Questions

    List the important features of MongoDB.

    The important features of MongoDB are listed below: –Aggregation framework– it uses aggregation framework for the..

    MongoDB Interview Questions

    Which all languages can be used with MongoDB?

    Here goes a list of the languages which can be used with MongoDB: – C C++ C# Java Node.js Perl PHP Python Ruby Scala..