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

Add MongoClient helper to access the current TopologyDescription

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 3.12, 4.0
    • API

    Description

      We should add a MongoClient helper to access the current TopologyDescription. Like:

      >>> client.topology_description
      <TopologyDescription id: 5ff38c18626b97e99fdd1224, topology_type: Single, servers: [<ServerDescription ('localhost', 27017) server_type: RSPrimary, rtt: 0.000817559481098>]>
      

      This is useful for debugging and also can replace a lot of the other MongoClient helpers like client.is_primary, is_mongos, nodes, arbiters, etc...

      For example, this ticket would resolve PYTHON-2476.

      Attachments

        Issue Links

          Activity

            People

              william.zhou@mongodb.com William Zhou
              shane.harvey@mongodb.com Shane Harvey
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: