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 remove a field from MongoDB?
- How to query with "not in" condition in MongoDB?
- How to use the limit operator in MongoDB?
- How to rename a field in MongoDB?
- How to create a many to many relation in MongoDB?
- How to drop a database in MongoDB?
- How to update an array element in MongoDB?
- How to create a collection in MongoDB?
- How to specify a password for MongoDB Docker?
- How to empty an array in MongoDB?
See more codes...