how to issue a “show dbs” from pymongo

from pymongo import MongoClient
# Assuming youre running mongod on 'localhost' with port 27017
c = MongoClient('localhost',27017)
c.database_names()

Update 2020:

DeprecationWarning: database_names is deprecated

Use the following:

c.list_database_names()

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)