Search code examples
databasemongodbmongodb-query

How to list all databases in the mongo shell?


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


Solution

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

    For more information on mongo shell commands, refer the MongoDB Shell (mongosh) documentation.