MongoDB – Drop a database

To drop a database in mongodb We can use “dropDatabase” command.
First we need to use the database we want to drop. and then use that command like this.
Suppose we have a database named students.

>use students;

db.dropDatabase();

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.