Skip to content

Commit bc914e8

Browse files
committed
DOCSP-48765: docker note (#124)
(cherry picked from commit 400f928)
1 parent a7e1336 commit bc914e8

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

source/connect/connection-targets.txt

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
103113
You can connect to a MongoDB replica set by specifying the members in a
104114
``ConnectionString``. The following example shows how to specify three members
105115
of 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

141145
API Documentation
142146
-----------------

0 commit comments

Comments
 (0)