show dbs
or
db.adminCommand('listDatabases')
db.getMongo().getDBNames()
show collections
show tables
db.getCollectionNames()
Read Articlehttps://develop.horje.com/learn/1434/reference