MongoDB difference between show dbs and show databases?

In MongoDB, there is no functional difference between show dbs and show databases. Both commands are aliases that internally call the same listDatabases command and produce identical output.

Syntax

show dbs

OR

show databases

Example: Using show dbs

show dbs
admin           0.002GB
app             0.000GB
business        0.000GB
config          0.000GB
local           0.000GB
main            0.000GB
my              0.001GB
ok              0.001GB
sample          0.003GB
sampleDemo      0.000GB
studentSearch   0.000GB
test            0.034GB
university      0.000GB
web             0.003GB
webcustomertracker 0.000GB

Example: Using show databases

show databases
admin           0.002GB
app             0.000GB
business        0.000GB
config          0.000GB
local           0.000GB
main            0.000GB
my              0.001GB
ok              0.001GB
sample          0.003GB
sampleDemo      0.000GB
studentSearch   0.000GB
test            0.034GB
university      0.000GB
web             0.003GB
webcustomertracker 0.000GB

Key Points

  • Both commands display all databases accessible to the current user
  • show dbs is the shorter, more commonly used version
  • Both show database names along with their storage sizes
  • Output includes system databases like admin, config, and local

Conclusion

show dbs and show databases are interchangeable commands that list all available databases. Use whichever you prefer ? most MongoDB users favor the shorter show dbs for convenience.

Updated on: 2026-03-15T02:43:28+05:30

363 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements