mongodbHow to list databases in MongoDB?
To list databases in MongoDB, use the show dbs
command. This command will display a list of all databases on the MongoDB server.
Example
> show dbs
admin 0.000GB
config 0.000GB
local 0.000GB
The output of the show dbs
command will list all databases on the MongoDB server, along with their respective sizes in GB. The admin
, config
, and local
databases are the default databases that come with MongoDB.
Code explanation
show dbs
: command to list all databases on the MongoDB serveradmin
,config
, andlocal
: default databases that come with MongoDB
Helpful links
More of Mongodb
- How to check the version of MongoDB?
- How to use watch in MongoDB?
- How to update one document in MongoDB?
- How to update many documents in MongoDB?
- How to use MongoDB queue?
- How to create a many to many relation in MongoDB?
- How to insert new document into MongoDB?
- How to use hint in MongoDB?
- How to work with time series data in MongoDB?
- How to use unwind in MongoDB?
See more codes...