Index
Getting DB By Name


Open command prompt
> mongo
Shell Opens


> let myDb = db.getSiblingDB('jewelry')
> myDb.getName()
jewelry
> myDb.getCollectionNames()
...
myDb.dropDatabase()


Getting DB By Name


> let dbNames = db.getMongo().getDBNames()
> dbNames.forEach(ea -> print(ea))


Dropping All Databases


> dbNames = db.getMongo().getDBNames()
> dbNames = dbNames.filter(eaName => !['admin', 'config', 'local'].includes(eaName))
> dbNames.forEach(eaName => db.getSiblingDB(eaName).dropDatabase())