MongoDB Delete Database

MongoDB Delete Database

 MongoDB Delete Database


The dropDatabase() command is used to delete the current database calculating all the associated data files. To remove any database first you need to select that database. You can use show dbs command to list available databases.

> use mydb

Now run the drop database command to delete the currently selected database. Before deleting any database, make sure to take backup Mongodb database.

> db.dropDatabase()

{ "dropped" : "mydb", "ok" : 1 }
Souy Soeng

Souy Soeng

Our website teaches and reads PHP, Framework Laravel, and how to download Admin template sample source code free. Thank you for being so supportive!

Github

Post a Comment

CAN FEEDBACK
close