diff --git a/source/connect/connection-targets.txt b/source/connect/connection-targets.txt index 625e85a..f0332ef 100644 --- a/source/connect/connection-targets.txt +++ b/source/connect/connection-targets.txt @@ -85,6 +85,16 @@ automatic discovery, perform one of the following actions: - Specify ``false`` as the value of the ``directConnection`` parameter. - Specify more than one host in the replica set. +.. note:: + + The ``MongoClient`` constructor is *non-blocking*. + When you connect to a replica set, the constructor returns immediately while the + client uses background threads to connect to the replica set. + + If you construct a ``MongoClient`` and immediately print the string representation + of its ``nodes`` attribute, the list might be empty while the client connects to + the replica-set members. + The following examples show how to connect to a MongoDB replica set running on port ``27017`` of three different hosts by using either the ``ConnectionString`` or ``MongoClientSettings`` class. Select the tab that corresponds to your preferred class. @@ -109,12 +119,6 @@ The following examples show how to connect to a MongoDB replica set running on p :end-before: end-connect-rs-settings :dedent: -.. note:: +.. note:: Replica Set in Docker - The ``MongoClient`` constructor is *non-blocking*. - When you connect to a replica set, the constructor returns immediately while the - client uses background threads to connect to the replica set. - - If you construct a ``MongoClient`` and immediately print the string representation - of its ``nodes`` attribute, the list might be empty while the client connects to - the replica-set members. + .. sharedinclude:: dbx/docker-replica-set.rst