Run
import pymongo myclient = pymongo.MongoClient("mongodb://localhost:27017/") for db in myclient.list_databases(): print(db)
Output