- Reference >
mongoshMethods >- Connection Methods >
- Mongo.getDBs()
Mongo.getDBs()¶
On this page
Description¶
-
Mongo.getDBs()¶ Returns information about all available databases.
Mongo.getDBs()uses thelistDatabasescommand.The
Mongo.getDBs()method doesn’t take any parameters.
Example¶
To list the available databases and metadata for the local MongoDB instance:
The db.getMongo() method returns the connection to the
current MongoDB instance. The Mongo.getDBs() output
resembles:
The databases are listed in the highlighted lines.