How to list all databases in the mongo shell?

fracz picture fracz · Sep 20, 2014 · Viewed 250.5k times · Source

I know how to list all collections in a particular database, but how do I list all available databases in MongoDB shell?

Answer

Robert Christopher picture Robert Christopher · Sep 20, 2014

Listing all the databases in mongoDB console is using the command show dbs.

For more information on this, refer the Mongo Shell Command Helpers that can be used in the mongo shell.