Skip to content

Commit 46539cf

Browse files
author
Chris Cho
authored
091423: fix malformed connection uri on MongoClientSettings page (#440)
* 091423: fix malformed connection uri on MongoClientSettings page
1 parent 694ed27 commit 46539cf

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

source/fundamentals/connection/mongoclientsettings.txt

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,13 @@ connection behavior:
121121
| **Default**: ``primary``
122122

123123
* - ``retryReads()``
124-
- | Whether the driver should :manual:`retry reads </core/retryable-reads/>`
124+
- | Whether the driver performs :manual:`retry reads </core/retryable-reads/>`
125125
if a network error occurs.
126126
|
127127
| **Default**: ``true``
128128

129129
* - ``retryWrites()``
130-
- | Whether the driver should :manual:`retry writes </core/retryable-writes/>`
130+
- | Whether the driver performs :manual:`retry writes </core/retryable-writes/>`
131131
if a network error occurs.
132132
|
133133
| **Default**: ``true``
@@ -163,12 +163,6 @@ This example demonstrates specifying a ``ConnectionString``:
163163
:emphasize-lines: 3
164164
:dedent:
165165

166-
.. tip::
167-
168-
Each setting has an ``applyConnectionString()`` method. They are
169-
rarely needed within the settings, so you should use this method as shown
170-
in :ref:`the preceding example <connection-string-example>`.
171-
172166
.. note:: Chain Order
173167

174168
Some options in the settings map to a connection string option.
@@ -187,7 +181,7 @@ This example demonstrates specifying a ``ConnectionString``:
187181
:emphasize-lines: 2,4
188182

189183
MongoClient mongoClient = MongoClients.create(
190-
MongoClientSettings.builder().applyConnectionString(new ConnectionString("mongodb+srv:/<username>:<password>@<hostname>:<port>?connectTimeoutMS(2000)"))
184+
MongoClientSettings.builder().applyConnectionString(new ConnectionString("mongodb+srv://<username>:<password>@<hostname>:<port>/<auth db>?connectTimeoutMS=2000"))
191185
.applyToSocketSettings(builder ->
192186
builder.connectTimeout(5, SECONDS))
193187
.build());

0 commit comments

Comments
 (0)