Add MongoClient helper to access the current TopologyDescription

XMLWordPrintableJSON

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

      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
              Reporter:
              Shane Harvey
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: