MongoDB difference between show dbs and show databases?

MongoDBBig Data AnalyticsDatabase

There is no difference between show dbs and show databases. Both commands internally call listDatabases command.

The show dbs command is as follows −

> show dbs

This will produce the following output −

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

The show databases command is as follows −

> show databases

This will produce the following output −

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
raja
Published on 02-Apr-2020 16:40:46
Advertisements