Skip to content

Commit 7d24b9d

Browse files
author
Chris Cho
committed
091423: fix malformed connection uri on MongoClientSettings page (#440)
* 091423: fix malformed connection uri on MongoClientSettings page (cherry picked from commit 46539cf)
1 parent 4e335da commit 7d24b9d

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
@@ -117,13 +117,13 @@ connection behavior:
117117
| **Default**: ``primary``
118118

119119
* - ``retryReads()``
120-
- | Whether the driver should :manual:`retry reads </core/retryable-reads/>`
120+
- | Whether the driver performs :manual:`retry reads </core/retryable-reads/>`
121121
if a network error occurs.
122122
|
123123
| **Default**: ``true``
124124

125125
* - ``retryWrites()``
126-
- | Whether the driver should :manual:`retry writes </core/retryable-writes/>`
126+
- | Whether the driver performs :manual:`retry writes </core/retryable-writes/>`
127127
if a network error occurs.
128128
|
129129
| **Default**: ``true``
@@ -159,12 +159,6 @@ This example demonstrates specifying a ``ConnectionString``:
159159
:emphasize-lines: 3
160160
:dedent:
161161

162-
.. tip::
163-
164-
Each setting has an ``applyConnectionString()`` method. They are
165-
rarely needed within the settings, so you should use this method as shown
166-
in :ref:`the preceding example <connection-string-example>`.
167-
168162
.. note:: Chain Order
169163

170164
Some options in the settings map to a connection string option.
@@ -183,7 +177,7 @@ This example demonstrates specifying a ``ConnectionString``:
183177
:emphasize-lines: 2,4
184178

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

0 commit comments

Comments
 (0)