MONGODB Questions and Answers

What is the syntax to create a collection and to drop a collection in MongoDB?

  • Syntax to create collection in MongoDB is db.createCollection(name,options)
  • Syntax to drop collection in MongoDB is db.collection.drop()