MongoDB Drop Collection
Use db.collection.drop() statement to delete existing collection. The result will be true on successful deletion.
Syntax
First, use the below commands to select the database and list available collections.
MongoDB Drop Collection
Finally, delete the collection named admin using the below methods from the mydb database.
Also, you can also use drop() method with getCollection() to remove the existing collection as follows.
0 Comments
CAN FEEDBACK
Emoji