Delete database in MongoDB

In previous tutorial, we known how to create a database in MongoDB. In this tutorial, we will figure out how we can delete a existing database MongoDB!

First of all, you must login into MongoDB and choose the database which we need to delete by following command:

Example, here I need delete a database named books, I will login into MongoDB and choose the database books as below:

Delete database in MongoDB

To check list of existing databases in MongoDB, you can use the command:

Delete database in MongoDB

Now, to delete a database, we will use the command:

Here, I delete the database books as below:

Delete database in MongoDB

Verify again list of databases:

Delete database in MongoDB

 

Add Comment