How do I drop a MongoDB database from the command line ?
We can use the following code:
mongo <dbname> --eval "db.dropDatabase()"
Further details on scripting the shell from the below link:
This is the excellent way to do it from mongodb console:
> use mydb; > db.dropDatabase();
Here another, we can stop mongod and delete the data files from your data directory, then restart.
Tips: we can also move the data files to a subfolder, and delete them if we are sure you no longer need them.