Answers for "drop database mongodb command line"

19

drop mongo database

// First show what databases have you gotten 
show dbs
// then, use the database name that you want to drop
use YOUR_DATABASE_NAME
// now you can drop it
db.dropDatabase()
// show collections should be empty now
show collections
Posted by: Guest on June-05-2020
2

how to drop db in mongo shell

use DB_NAME       // go to the db you want to delete

db.dropDatabase()

show dbs
// droppped db will not be shown
Posted by: Guest on September-16-2020
3

mongodb drop db

db.dropDatabase()
Posted by: Guest on December-11-2020
3

drop database mongodb command line

mongo <dbname> --eval "db.dropDatabase()"
Posted by: Guest on July-19-2020

Code answers related to "drop database mongodb command line"

Browse Popular Code Answers by Language