Answers for "delete all mongodb databases"

Go
0

remove all db entries from mongo

db.users.remove({})
Posted by: Guest on June-28-2021
0

mongo remove all dbs

mongo --quiet --eval 'db.getMongo().getDBNames().forEach(function(i){db.getSiblingDB(i).dropDatabase()})'
Posted by: Guest on September-14-2020
0

drop multiple database mongo

// if you have a list of Databases to delete then you may run the following command?


['db1', 'db2', 'db3', 'db4'].forEach(function(i){db.getSiblingDB(i).dropDatabase()})
Posted by: Guest on November-02-2020

Code answers related to "delete all mongodb databases"

Browse Popular Code Answers by Language