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

MongoClient with multiple hosts and directConnection=True does not raise an error

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.11
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      Passing multiple hosts with directConnection=True should raise an error but does not:

      >>> client = MongoClient(['localhost:27017', 'localhost:27018'], directConnection=True)
      >>> client
      MongoClient(host=['localhost:27018', 'localhost:27017'], document_class=dict, tz_aware=False, connect=True, directconnection=True)
      >>> client._topology
      <Topology <TopologyDescription id: 5ee92ea84355c7f1de7bd6cb, topology_type: Single, servers: [<ServerDescription ('localhost', 27017) server_type: RSPrimary, rtt: 0.000634608000012804>, <ServerDescription ('localhost', 27018) server_type: RSSecondary, rtt: 0.0005638819999944644>]>>
      

            Assignee:
            prashant.mital Prashant Mital (Inactive)
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: