You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
object to the `MongoClients.create() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoClients.html#create(com.mongodb.MongoClientSettings)>`__
35
35
method.
@@ -52,7 +52,7 @@ settings to modify the driver's behavior:
52
52
* - ``addCommandListener()``
53
53
- Adds a listener for :ref:`command events <command-events-java>`.
54
54
55
-
* - ``applicationName()``
55
+
* - ``applicationName()``
56
56
- Sets the logical name of the application using the ``MongoClient``.
57
57
58
58
* - ``applyConnectionString()``
@@ -74,7 +74,7 @@ settings to modify the driver's behavior:
74
74
- Applies the ``SslSettings.Builder`` block and then sets the :ref:`TLS/SSL settings <mcs-ssl-settings>`.
75
75
76
76
* - ``autoEncryptionSettings()``
77
-
- | Sets the :ref:`auto-encryption settings <auto-encryption-decryption-java>`.
77
+
- | Sets the :ref:`auto-encryption settings <auto-encryption-decryption-java>`.
78
78
|
79
79
| If you omit ``keyVaultClient`` or set
80
80
| ``bypassAutomaticEncryption`` to false in your
@@ -97,7 +97,7 @@ settings to modify the driver's behavior:
97
97
* - ``credential()``
98
98
- Sets the :ref:`credential <authentication-mechanisms-java>`.
99
99
100
-
* - ``readConcern()``
100
+
* - ``readConcern()``
101
101
- Sets the :manual:`read concern </reference/read-concern/>`.
102
102
103
103
* - ``readPreference()``
@@ -106,10 +106,10 @@ settings to modify the driver's behavior:
106
106
* - ``retryReads()``
107
107
- Whether the driver should :manual:`retry reads </core/retryable-reads/>` if a network error occurs.
108
108
109
-
* - ``retryWrites()``
109
+
* - ``retryWrites()``
110
110
- Whether the driver should :manual:`retry writes </core/retryable-writes/>` if a network error occurs.
111
111
112
-
* - ``serverApi()``
112
+
* - ``serverApi()``
113
113
- Sets the :ref:`server API <versioned-api-java>` to use when sending commands to the server.
114
114
115
115
* - ``streamFactoryFactory()``
@@ -118,7 +118,7 @@ settings to modify the driver's behavior:
118
118
* - ``uuidRepresentation()``
119
119
- Sets the UUID representation to use when encoding instances of UUID and decoding BSON binary values with subtype of 3.
120
120
121
-
* - ``writeConcern()``
121
+
* - ``writeConcern()``
122
122
- Sets the :manual:`write concern </reference/write-concern/>`.
123
123
124
124
.. _connection-string-example:
@@ -186,22 +186,22 @@ settings to modify the driver's behavior:
186
186
* - Method
187
187
- Description
188
188
189
-
* - ``addClusterListener()``
189
+
* - ``addClusterListener()``
190
190
- Adds a listener for cluster-related events.
191
191
192
-
* - ``applyConnectionString()``
192
+
* - ``applyConnectionString()``
193
193
- Uses the settings from a ``ConnectionString`` object.
194
194
195
195
* - ``applySettings()``
196
196
- Uses the cluster settings specified in a ``ClusterSettings`` object.
197
197
198
-
* - ``hosts()``
198
+
* - ``hosts()``
199
199
- Sets all the specified locations of a Mongo server.
200
200
201
201
* - ``localThreshold()``
202
202
- Sets the amount of time that a server’s round trip can take and still be eligible for server selection.
203
203
204
-
* - ``mode()``
204
+
* - ``mode()``
205
205
- Sets how to connect to a MongoDB server.
206
206
207
207
* - ``requiredClusterType()``
@@ -218,23 +218,30 @@ settings to modify the driver's behavior:
218
218
219
219
* - ``srvHost()``
220
220
- Sets the host name to use to look up an SRV DNS record to find the MongoDB hosts.
221
-
221
+
222
222
.. note::
223
-
223
+
224
224
When setting ``srvHost``, the driver does not process any
225
-
associated TXT records associated with the host.
225
+
associated TXT records associated with the host.
226
226
227
227
If you want to enable the processing of TXT records, you must
228
-
specify the SRV host in the connection string using the
228
+
specify the SRV host in the connection string using the
- | Sets the maximum number of hosts the driver can connect to when using
240
+
the DNS seedlist (SRV) connection protocol, identified by the
241
+
``mongodb+srv`` connection string prefix.
242
+
|
243
+
| Throws an exception if you are not using the SRV connection protocol.
244
+
238
245
Example
239
246
~~~~~~~
240
247
@@ -273,7 +280,7 @@ settings to modify the driver's behavior:
273
280
* - Method
274
281
- Description
275
282
276
-
* - ``applyConnectionString()``
283
+
* - ``applyConnectionString()``
277
284
- Uses the settings from a ``ConnectionString`` object.
278
285
279
286
* - ``applySettings()``
@@ -312,7 +319,7 @@ Connection Pool Settings
312
319
------------------------
313
320
314
321
Chain the `applyToConnectionPoolSettings() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.Builder.html#applyToConnectionPoolSettings(com.mongodb.Block)>`__
315
-
method to modify the way the driver manages its' connection pool.
322
+
method to modify the way the driver manages its connection pool.
316
323
317
324
The following table describes all the methods you can chain to your
318
325
settings to modify the driver's behavior:
@@ -324,10 +331,10 @@ settings to modify the driver's behavior:
324
331
* - Method
325
332
- Description
326
333
327
-
* - ``addConnectionPoolListener()``
334
+
* - ``addConnectionPoolListener()``
328
335
- Adds a listener for connection pool-related events.
329
336
330
-
* - ``applyConnectionString()``
337
+
* - ``applyConnectionString()``
331
338
- Uses the settings from a ``ConnectionString`` object.
332
339
333
340
* - ``applySettings()``
@@ -354,6 +361,7 @@ settings to modify the driver's behavior:
354
361
* - ``minSize()``
355
362
- Sets the minimum amount of connections associated with a connection pool.
356
363
364
+
357
365
.. note::
358
366
359
367
This ``maxSize`` and ``minSize`` settings apply to each server
@@ -401,10 +409,10 @@ settings to modify the driver's behavior:
401
409
* - ``addServerListener()``
402
410
- Adds a listener for server-related events.
403
411
404
-
* - ``addServerMonitorListener()``
412
+
* - ``addServerMonitorListener()``
405
413
- Adds a listener for server monitor-related events.
406
414
407
-
* - ``applyConnectionString()``
415
+
* - ``applyConnectionString()``
408
416
- Uses the settings from a ``ConnectionString`` object.
409
417
410
418
* - ``applySettings()``
@@ -421,7 +429,7 @@ Example
421
429
422
430
This example specifies the following driver behavior in a MongoDB server:
423
431
424
-
- The minimum interval for server monitoring checks to be at least ``700 MILLISECONDS``
432
+
- The minimum interval for server monitoring checks to be at least ``700 MILLISECONDS``
425
433
- The cluster monitor to attempt reaching a server every ``15 SECONDS``
0 commit comments