Skip to content

Commit 868befe

Browse files
authored
DOCSP-29467: Added default MongoClient settings values (#387)
* DOCSP-29467: Added default MongoClient settings values * Formatting adjustment * PR feedback * Tech review feedback and trying to fix formatting * Formatting fix * Added link
1 parent 3f82ba1 commit 868befe

File tree

1 file changed

+65
-32
lines changed

1 file changed

+65
-32
lines changed

source/fundamentals/connection/mongoclientsettings.txt

Lines changed: 65 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,13 @@ connection behavior:
9191
- | Sets the :ref:`auto-encryption settings <csfle-fundamentals-automatic-encryption>`.
9292
|
9393
| If you omit ``keyVaultClient`` or set
94-
| ``bypassAutomaticEncryption`` to false in your
95-
| ``AutoEncryptionSettings``, the driver creates a separate,
96-
| internal ``MongoClient``.
94+
``bypassAutomaticEncryption`` to false in your
95+
``AutoEncryptionSettings``, the driver creates a separate,
96+
internal ``MongoClient``.
9797
|
9898
| The internal ``MongoClient`` configuration differs from the
99-
| parent ``MongoClient`` by setting the ``minPoolSize`` to 0 and
100-
| omitting the ``AutoEncryptionSettings``.
99+
parent ``MongoClient`` by setting the ``minPoolSize`` to 0 and
100+
omitting the ``AutoEncryptionSettings``.
101101

102102
* - ``codecRegistry()``
103103
- Sets the :ref:`codec registry <codecs-codecregistry>`.
@@ -116,15 +116,21 @@ connection behavior:
116116
- Sets the :manual:`read concern </reference/read-concern/>`.
117117

118118
* - ``readPreference()``
119-
- Sets the :manual:`read preference </core/read-preference/>`.
119+
- | Sets the :manual:`read preference </core/read-preference/>`.
120+
|
121+
| **Default**: ``primary``
120122

121123
* - ``retryReads()``
122-
- Whether the driver should :manual:`retry reads </core/retryable-reads/>`
123-
if a network error occurs.
124+
- | Whether the driver should :manual:`retry reads </core/retryable-reads/>`
125+
if a network error occurs.
126+
|
127+
| **Default**: ``true``
124128

125129
* - ``retryWrites()``
126-
- Whether the driver should :manual:`retry writes </core/retryable-writes/>`
127-
if a network error occurs.
130+
- | Whether the driver should :manual:`retry writes </core/retryable-writes/>`
131+
if a network error occurs.
132+
|
133+
| **Default**: ``true``
128134

129135
* - ``serverApi()``
130136
- Sets the :ref:`server API <stable-api-java>` to use when sending
@@ -138,7 +144,10 @@ connection behavior:
138144
and decoding BSON binary values with subtype of 3.
139145

140146
* - ``writeConcern()``
141-
- Sets the :manual:`write concern </reference/write-concern/>`.
147+
- | Sets the :manual:`write concern </reference/write-concern/>`.
148+
|
149+
| **Default**: ``WriteConcern#ACKNOWLEDGED``. For more information about
150+
the default value, see :manual:`Implicit Default Write Concern </reference/write-concern/#implicit-default-write-concern>`.
142151

143152
.. _connection-string-example:
144153

@@ -228,8 +237,10 @@ settings to modify the driver's behavior:
228237
- Sets all the specified locations of a Mongo server.
229238

230239
* - ``localThreshold()``
231-
- Sets the amount of time that a server’s round trip can take and still
232-
be eligible for server selection.
240+
- | Sets the amount of time that a server’s round trip can take and still
241+
be eligible for server selection.
242+
|
243+
| **Default**: ``15 milliseconds``
233244

234245
* - ``mode()``
235246
- Sets how to connect to a MongoDB server.
@@ -241,8 +252,10 @@ settings to modify the driver's behavior:
241252
- Sets the replica set name required for the cluster.
242253

243254
* - ``serverSelectionTimeout()``
244-
- Sets the maximum time to select a primary node before throwing a
245-
timeout exception.
255+
- | Sets the maximum time to select a primary node before throwing a
256+
timeout exception.
257+
|
258+
| **Default**: ``30 seconds``
246259

247260
* - ``serverSelector()``
248261
- Adds a server selector to apply before server selection.
@@ -334,16 +347,22 @@ settings to modify the driver's behavior:
334347
- Sets the maximum time a pooled connection can be alive before it's
335348
closed.
336349

337-
* - ``maxWaitTime()``
338-
- Sets the maximum time to wait for an available connection.
339-
340350
* - ``maxSize()``
341-
- Sets the maximum amount of connections associated with a connection
342-
pool.
351+
- | Sets the maximum number of connections associated with a connection
352+
pool.
353+
|
354+
| **Default**: ``100``
355+
356+
* - ``maxWaitTime()``
357+
- | Sets the maximum time to wait for an available connection.
358+
|
359+
| **Default**: ``2 minutes``
343360

344361
* - ``minSize()``
345-
- Sets the minimum amount of connections associated with a connection
346-
pool.
362+
- | Sets the minimum number of connections associated with a connection
363+
pool.
364+
|
365+
| **Default**: ``0``
347366

348367

349368
.. note::
@@ -390,8 +409,10 @@ settings to modify the logging behavior:
390409
- Description
391410

392411
* - ``maxDocumentLength()``
393-
- Sets the maximum document length, in characters, of a single log
394-
message.
412+
- | Sets the maximum document length, in characters, of a single log
413+
message.
414+
|
415+
| **Default**: ``1000``
395416

396417
Example
397418
~~~~~~~
@@ -438,10 +459,14 @@ settings to modify the driver's behavior:
438459
- Uses the server settings specified in a ``ServerSettings`` object.
439460

440461
* - ``heartbeatFrequency()``
441-
- Sets the interval for a cluster monitor to attempt reaching a server.
462+
- | Sets the interval for a cluster monitor to attempt reaching a server.
463+
|
464+
| **Default**: ``10 seconds``
442465

443466
* - ``minHeartbeatFrequency()``
444-
- Sets the minimum interval for server monitoring checks.
467+
- | Sets the minimum interval for server monitoring checks.
468+
|
469+
| **Default**: ``500 milliseconds``
445470

446471
Example
447472
~~~~~~~
@@ -485,18 +510,26 @@ to modify the driver's behavior:
485510
- Uses the socket settings specified in a ``SocketSettings`` object.
486511

487512
* - ``connectTimeout()``
488-
- Sets the maximum time to connect to an available socket before throwing
489-
a timeout exception.
513+
- | Sets the maximum time to connect to an available socket before throwing
514+
a timeout exception.
515+
|
516+
| **Default**: ``10 seconds``
490517

491518
* - ``readTimeout()``
492-
- Sets the maximum time to read to an available socket before throwing a
493-
timeout exception.
519+
- | Sets the maximum time to read from an available socket before throwing a
520+
timeout exception.
521+
|
522+
| **Default**: ``0``, which indicates no timeout
494523

495524
* - ``receiveBufferSize()``
496-
- Sets the socket's buffer size when receiving.
525+
- | Sets the socket's buffer size when receiving.
526+
|
527+
| **Default**: The operating system default
497528

498529
* - ``sendBufferSize()``
499-
- Sets the socket's buffer size when sending.
530+
- | Sets the socket's buffer size when sending.
531+
|
532+
| **Default**: The operating system default
500533

501534
Example
502535
~~~~~~~

0 commit comments

Comments
 (0)