Drop Mongo Database

[Solved] Drop Mongo Database | Go - Code Explorer | yomemimo.com
Question : drop mongo database

Answered by : ghaith-alzin

// 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

Source : | Last Update : Fri, 12 Jun 20

Question : drop database mongodb command line

Answered by : vikas

mongo <dbname> --eval "db.dropDatabase()"

Source : | Last Update : Sun, 26 Jul 20

Answers related to drop mongo database

Code Explorer Popular Question For Go