MongoDB Drop Collection - MongoDB

How to drop a collection in MongoDB?

In this chapter, we will explain how to drop a collection using MongoDB.

drop() Method

MongoDB's db.collection.drop() is used for droping a collection from the database.


Basic syntax of drop() command is as follows


First, check the available collections into your database mydb.

Ccollection can be dropped with the name mycollection.

Again check the list of collections into database.

drop() method will return true, if the selected collection is dropped successfully, else it will return false.

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd Protection Status

MongoDB Topics