Is it possible to ping mongodb from pymongo
You can use pymongo.database.Database.command to send custom command like:
from pymongo import MongoClient
client = MongoClient()
client.db_name.command('ping')
returns
{u'ok': 1.0}
In order to perform the ping agnostic of any specific database, it is also possible to use the admin database in order to perform the ping. This was documented in the old mongo_client
documentation
from pymongo import MongoClient
client = MongoClient()
client.admin.command('ping')