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

Add MongoClient helper to access the current TopologyDescription

    • Type: Icon: New Feature New Feature
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.12, 4.0
    • Affects Version/s: None
    • Component/s: API

      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.

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

              Created:
              Updated:
              Resolved: