Skip to content

Commit 10a5500

Browse files
authored
PYTHON-3626 Document srvMaxHosts in MongoClient options (mongodb#1167)
1 parent c27ce70 commit 10a5500

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pymongo/mongo_client.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,10 @@ def __init__(
401401
"mongodb+srv://" URIs. Defaults to "mongodb". Use it like so::
402402
403403
MongoClient("mongodb+srv://example.com/?srvServiceName=customname")
404+
- `srvMaxHosts`: (int) limits the number of mongos-like hosts a client will
405+
connect to. More specifically, when a "mongodb+srv://" connection string
406+
resolves to more than srvMaxHosts number of hosts, the client will randomly
407+
choose an srvMaxHosts sized subset of hosts.
404408
405409
406410
| **Write Concern options:**
@@ -575,8 +579,8 @@ def __init__(
575579
keyword arguments.
576580
- The default for `uuidRepresentation` was changed from
577581
``pythonLegacy`` to ``unspecified``.
578-
- Added the ``srvServiceName`` and ``maxConnecting`` URI and
579-
keyword argument.
582+
- Added the ``srvServiceName``, ``maxConnecting``, and ``srvMaxHosts`` URI and
583+
keyword arguments.
580584
581585
.. versionchanged:: 3.12
582586
Added the ``server_api`` keyword argument.

0 commit comments

Comments
 (0)