@@ -9,7 +9,7 @@ Choose a Connection Target
99 :values: reference
1010
1111.. meta::
12- :keywords: connection string, URI, server, settings, client
12+ :keywords: connection string, URI, server, settings, client, load balancing
1313
1414.. contents:: On this page
1515 :local:
@@ -74,6 +74,15 @@ Replica Sets
7474To connect to a replica set, specify the hostnames (or IP addresses) and
7575port numbers of the replica-set members in your connection string.
7676
77+ The following code shows how to use {+driver-short+} to connect to a replica set
78+ that contains three hosts:
79+
80+ .. code-block:: python
81+
82+ from pymongo import MongoClient
83+
84+ client = MongoClient("mongodb://host1:27017,host2:27017,host3:27017")
85+
7786If you aren't able to provide a full list of hosts in the replica set, you can
7887specify one or more of the hosts in the replica set and instruct {+driver-short+} to
7988perform automatic discovery to find the others. To instruct the driver to perform
@@ -94,6 +103,11 @@ hosts, including ``host1``:
94103 uri = "mongodb://host1:27017/?replicaSet=sampleRS"
95104 client = MongoClient(uri)
96105
106+ {+driver-short+} evenly load balances operations across deployments that are reachable
107+ within the client's ``localThresholdMS`` value. To learn more about how {+driver-short+} load
108+ balances operations across multiple MongoDB deployments, see the
109+ :ref:`pymongo-server-selection` guide.
110+
97111.. note::
98112
99113 The ``MongoClient`` constructor is *non-blocking*.
0 commit comments