drop whole database within a single command of restoring the dump of mongodb
I am trying to restore the directory dump of mongodb. i am doing mongorestore --db mydb --drop path/to/mydb/dump But both does not able to restore the state of my dump. Any new records are visible even after restoring the db. But no error is shown on console. I didn't see an answer and I had the same question today. You can drop the database before with: use <db> db.dropDatabase() Or you can only drop the collection with: db.<collection>.drop() The problem with your command could be that something misses, like the database which you authenticate against or the user or maybe another thing. In