show dbs
or
db.adminCommand('listDatabases')
db.getMongo().getDBNames()
show collections
show tables
db.getCollectionNames()