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

MongoDB Drop Database

Check the list of databases , using the show dbs command.

>show dbs


>show dbs

local 0.4352GB

test 0.1265GB

Employee 0.2431GB

Let’s select database  name to delete, In this example we will drop Employee database.

> use Employee
switched to db Employee

Run the deletion by calling the db.dropDatabase() method,

> db.dropDatabase()
{ "dropped" : "Employee", "ok" : 1 }

Here we have covered MongoDB drop database.

Leave a Comment

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