In this bankruptcy, we will see how to drop a set the use of MongoDB.
The drop() Method
MongoDB's db.Collection.Drop() is used to drop a set from the database.
Syntax
Basic syntax of drop() command is as follows −
db.COLLECTION_NAME.drop()
Example
First, take a look at the to be had collections into your database mydb.
>use mydb
switched to db mydb
>show collections
mycol
mycollection
system.indexes
tutorialspoint
>
Now drop the gathering with the name mycollection.
>db.mycollection.drop()
true
>
Again take a look at the listing of collections into database.
>show collections
mycol
system.indexes
tutorialspoint
>
drop() method will return proper, if the selected series is dropped effectively, otherwise it's going to go back false.