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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 3.11
    • None
    • None

    Description

      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>]>>
      

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: