Drop Database

db.dropDatabase() method is used to drop the database.

Note:- When you drop the database then all collections and documents will be deleted off from this database.

Syntax:-


use databaseName
> db.dropDatabase()

Example:- Firstly check all database


show dbs

Output:-

employee_management
school_management

Now delete the database


use employee_management
> db.dropDatabase()

Now check the database


show dbs

Output:-

school_management