-
Type:
Task
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
We need to update this example from the MongoClient docs:
from pymongo.errors import ConnectionFailure
client = MongoClient()
try:
# The ismaster command is cheap and does not require auth.
client.admin.command('ismaster')
except ConnectionFailure:
print("Server not available")
The new example should use ping:
from pymongo.errors import ConnectionFailure
client = MongoClient()
try:
# The ping command is cheap and does not require auth.
client.admin.command('ping')
except ConnectionFailure:
print("Server not available")