1. Home
  2. MongoDB
  3. MongoDB Tutorial
  4. MongoDB – Drop Database

MongoDB – Drop Database

MongoDB Delete Database

The dropDatabase() command removes the current database and deletes 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.

> db.dropDatabase()

{ "dropped" : "mydb", "ok" : 1 }
Was this article helpful to you? Yes 5 No