You can use the db.runCommand( { dropDatabase: 1 } )
and its wrapper db.dropDatabase()
from the command line mongo
shell to drop a database and its associated files. Note that the database delete operation removes all the collections in it.
For example, from the mongo
shell delete the "mydb" database:
use mydb
db.dropDatabase()
// -or- from any current database:
db.getSiblingDB("mydb").dropDatabase()
The following are the aspects which are concerned with this command: write concern, locks, user management, indexes and the clusters (replica sets and sharded); refer the following links for details: dropDatabase command and db.dropDatabase().
You can also drop a database from the MongoDB Compass GUI tool.
You can also execute the drop database command from any of the MongoDB programming language driver APIs.