Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-2848

Update documentation to prefer ping command over ismaster

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.12, 4.0
    • Affects Version/s: None
    • Component/s: 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")
      

      See https://www.mongodb.com/community/forums/t/how-to-use-the-new-hello-interface-for-availability/116748/1

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: