MongoDB - Drop Collection
MongoDB - Drop Collection the way to drop a collection the use of MongoDB.
The drop() MethodMongoDB's db.Collection.Drop() is used to drop a group from the database.
SyntaxThere are following Basic syntax of drop() command
ExampleFirst, take a look at the to be had collections into your database mydb.
>use mydb switched to db mydb >show collections mycol mycollection gadget.indexes welookups >Now drop the collection with the name mycollection.
>db.mycollection.drop() true >Again check the listing of collections into database.
>display collections mycol machine.indexes welookups >drop() method will go back genuine, if the selected series is dropped successfully, in any other case it'll go back false.