@@ -100,6 +100,16 @@ automatic discovery, perform one of the following actions:
100100- Specify ``false`` as the value of the ``directConnection`` parameter.
101101- Specify more than one host in the replica set.
102102
103+ .. note::
104+
105+ The ``MongoClient`` constructor is *non-blocking*.
106+ When you connect to a replica set, the constructor returns immediately while the
107+ client uses background threads to connect to the replica set.
108+
109+ If you construct a ``MongoClient`` and immediately print the string representation
110+ of its ``nodes`` attribute, the list might be empty while the client connects to
111+ the replica-set members.
112+
103113You can connect to a MongoDB replica set by specifying the members in a
104114``ConnectionString``. The following example shows how to specify three members
105115of the replica set:
@@ -128,15 +138,9 @@ corresponding to all of the replica set members:
128138 :end-before: end-replica-set-server-address
129139 :dedent:
130140
131- .. note::
141+ .. note:: Replica Set in Docker
132142
133- The ``MongoClient`` constructor is *non-blocking*.
134- When you connect to a replica set, the constructor returns immediately while the
135- client uses background threads to connect to the replica set.
136-
137- If you construct a ``MongoClient`` and immediately print the string representation
138- of its ``nodes`` attribute, the list might be empty while the client connects to
139- the replica-set members.
143+ .. sharedinclude:: dbx/docker-replica-set.rst
140144
141145API Documentation
142146-----------------
0 commit comments