Skip to content

DOCSP-48758: docker note #92

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions source/connect/connection-targets.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Loading