Skip to content

Commit 22f3b7f

Browse files
authored
DOCSP-48699-directConnection-Docker-admonition (#398)
1 parent 656ec72 commit 22f3b7f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

source/connect.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,17 @@ To connect to a replica set, you can either:
258258
- Explicitly specify the replica set name and members in the connection
259259
string.
260260

261+
.. important::
262+
263+
When a replica set runs in Docker, it might expose only one
264+
MongoDB endpoint. In this case, the replica set is not discoverable, and specifying
265+
``directConnection=false`` can prevent your application from connecting to it.
266+
267+
In a test or development environment, you can connect to the replica set by specifying
268+
``directConnection=true`` in your connection URI. In a production environment, we
269+
recommend configuring the cluster to make each MongoDB instance accessible outside of
270+
the Docker virtual network.
271+
261272
Option 1: DNS Seedlist Format
262273
`````````````````````````````
263274

0 commit comments

Comments
 (0)