Skip to content

Commit 0e8abc6

Browse files
authored
Merge pull request #72 from steveren/DOCSP-13569
DOCSP-13569: [MONGOSH] Mongosh fails to connect to node in state STARTUP2
2 parents 80ab76d + b1db2b2 commit 0e8abc6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

source/connect.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,16 @@ To connect to a replica set:
162162

163163
mongosh "mongodb://mongodb0.example.com.local:27017,mongodb1.example.com.local:27017,mongodb2.example.com.local:27017/?replicaSet=replA"
164164

165+
.. note::
166+
167+
``mongosh`` adds the ``directConnection=true`` query parameter to the
168+
connection string automatically unless at least one of the following is
169+
true:
170+
171+
- The ``replicaSet`` query parameter is present in the connection string.
172+
- The connection string uses the ``mongodb+srv://`` scheme.
173+
- The connection string contains a seed list with multiple hosts.
174+
165175
Connect using TLS
166176
~~~~~~~~~~~~~~~~~
167177

0 commit comments

Comments
 (0)