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
@@ -37,54 +37,61 @@ String` or :guilabel:`MongoClientSettings` tab to see the options available:
37
37
:header-rows: 1
38
38
:widths: 20 10 20
39
39
40
-
* - Option Name
41
-
- Type
42
-
- Description
40
+
* - Option Name
41
+
- Type
42
+
- Description
43
43
44
-
* - **serverSelectionTimeoutMS**
45
-
- integer
46
-
- Specifies the maximum amount of time, in milliseconds, the driver
47
-
will wait for server selection to succeed before throwing an
48
-
exception.
49
-
44
+
* - **serverSelectionTimeoutMS**
45
+
- integer
46
+
- | Specifies the maximum amount of time, in milliseconds, the driver
47
+
will wait for server selection to succeed before throwing an
48
+
exception.
49
+
|
50
50
| **Default**: ``30000`` (30 seconds)
51
51
52
-
* - **localThresholdMS**
53
-
- integer
54
-
- When communicating with multiple instances of MongoDB in a replica
55
-
set, the driver will only send requests to a server whose
56
-
response time is less than or equal to the server with the fastest
57
-
response time plus the local threshold, in milliseconds.
58
-
52
+
* - **localThresholdMS**
53
+
- integer
54
+
- | When communicating with multiple instances of MongoDB in a replica
55
+
set, the driver will only send requests to a server whose response
56
+
time is less than or equal to the server with the fastest response
57
+
time plus the local threshold, in milliseconds.
58
+
|
59
59
| **Default**: ``15``
60
60
61
-
* - **heartbeatFrequencyMS**
62
-
- integer
63
-
- Specifies the frequency, in milliseconds that the driver will
64
-
wait between attempts to determine the current state of each
65
-
server in the cluster.
66
-
61
+
* - **heartbeatFrequencyMS**
62
+
- integer
63
+
- Specifies the frequency, in milliseconds that the driver will wait
64
+
between attempts to determine the current state of each server in
65
+
the cluster.
66
+
|
67
67
| **Default**: ``10000`` (10 seconds)
68
68
69
-
* - **replicaSet**
70
-
- string
71
-
- Specifies that the :ref:`connection string <connection-uri>`
69
+
* - **replicaSet**
70
+
- string
71
+
- Specifies that the :ref:`connection string <connection-uri>`
72
72
provided includes multiple hosts. When specified, the driver
73
-
attempts to find all members of that set.
74
-
73
+
attempts to find all members of that set.
74
+
|
75
75
| **Default**: ``null``
76
76
77
-
* - **directConnection**
78
-
- boolean
79
-
- Specifies that the driver must connect to the host directly. This
80
-
maps to applying ``mode(ClusterConnectionMode.SINGLE)`` to your ``MongoClientSettings``.
81
-
77
+
* - **directConnection**
78
+
- boolean
79
+
- Specifies that the driver must connect to the host directly. This
80
+
maps to applying ``mode(ClusterConnectionMode.SINGLE)`` to your
81
+
``MongoClientSettings``.
82
+
|
82
83
| **Default**: ``false``
83
84
84
-
* - **srvServiceName**
85
-
- string
86
-
- Specifies the service name of the `SRV resource records <https://www.rfc-editor.org/rfc/rfc2782>`__ the driver retrieves to construct your :manual:`seed list </reference/glossary/#std-term-seed-list>`. You must use the :manual:`DNS Seed List Connection Format </reference/connection-string/#dns-seed-list-connection-format>` in your :ref:`connection URI <connection-uri>` to use this option.
87
-
85
+
* - **srvServiceName**
86
+
- string
87
+
- | Specifies the service name of the `SRV resource records
88
+
<https://www.rfc-editor.org/rfc/rfc2782>`__ the driver retrieves to
89
+
construct your :manual:`seed list
90
+
</reference/glossary/#std-term-seed-list>`. You must use the
91
+
:manual:`DNS Seed List Connection Format
92
+
</reference/connection-string/#dns-seed-list-connection-format>` in
93
+
your :ref:`connection URI <connection-uri>` to use this option.
94
+
|
88
95
| **Default**: ``mongodb``
89
96
90
97
.. tab:: MongoClientSettings
@@ -102,62 +109,69 @@ String` or :guilabel:`MongoClientSettings` tab to see the options available:
102
109
:header-rows: 1
103
110
:stub-columns: 1
104
111
:widths: 40 60
105
-
106
-
* - Method
107
-
- Description
108
-
109
-
* - ``addClusterListener()``
110
-
- Adds a listener for cluster-related events.
111
-
112
-
* - ``applyConnectionString()``
113
-
- Uses the settings from a ``ConnectionString`` object.
114
-
115
-
* - ``applySettings()``
116
-
- Uses the cluster settings specified in a ``ClusterSettings`` object.
117
-
118
-
* - ``hosts()``
119
-
- Sets all the specified locations of a Mongo deployment.
120
-
121
-
* - ``localThreshold()``
122
-
- | Sets the amount of time that a server’s round trip can take and still be eligible for server selection.
123
-
|
124
-
| **Default**: ``15 milliseconds``
125
-
126
-
* - ``mode()``
127
-
- Sets how to connect to a MongoDB deployment.
128
-
129
-
* - ``requiredClusterType()``
130
-
- Sets the type of cluster required for the cluster.
131
-
132
-
* - ``requiredReplicaSetName()``
133
-
- Sets the replica set name required for the cluster.
134
-
135
-
* - ``serverSelectionTimeout()``
136
-
- | Sets the maximum time to select a primary node before throwing a timeout exception.
137
-
|
138
-
| **Default**: ``30 seconds``
139
-
140
-
* - ``serverSelector()``
141
-
- Adds a server selector to apply before server selection.
142
-
143
-
* - ``srvHost()``
144
-
- | Sets the host name to use to look up an SRV DNS record to find the MongoDB hosts.
145
-
|
146
-
| If you want to enable the processing of TXT records associated with the host, specify the SRV host in the connection string using the ``applyConnectionString()`` method.
147
-
|
148
-
| For example:
112
+
113
+
* - Method
114
+
- Description
115
+
116
+
* - ``addClusterListener()``
117
+
- Adds a listener for cluster-related events.
118
+
119
+
* - ``applyConnectionString()``
120
+
- Uses the settings from a ``ConnectionString`` object.
121
+
122
+
* - ``applySettings()``
123
+
- Uses the cluster settings specified in a ``ClusterSettings`` object.
124
+
125
+
* - ``hosts()``
126
+
- Sets all the specified locations of a Mongo deployment.
127
+
128
+
* - ``localThreshold()``
129
+
- | Sets the amount of time that a server’s round trip can take and
130
+
still be eligible for server selection.
131
+
|
132
+
| **Default**: ``15 milliseconds``
133
+
134
+
* - ``mode()``
135
+
- Sets how to connect to a MongoDB deployment.
136
+
137
+
* - ``requiredClusterType()``
138
+
- Sets the type of cluster required for the cluster.
139
+
140
+
* - ``requiredReplicaSetName()``
141
+
- Sets the replica set name required for the cluster.
142
+
143
+
* - ``serverSelectionTimeout()``
144
+
- | Sets the maximum time to select a primary node before throwing a
145
+
timeout exception.
146
+
|
147
+
| **Default**: ``30 seconds``
148
+
149
+
* - ``serverSelector()``
150
+
- Adds a server selector to apply before server selection.
151
+
152
+
* - ``srvHost()``
153
+
- | Sets the host name to use to look up an SRV DNS record to find the
154
+
MongoDB hosts.
155
+
|
156
+
| If you want to enable the processing of TXT records associated
157
+
with the host, specify the SRV host in the connection string using
- | Sets the maximum number of hosts the driver can connect to when using the DNS seedlist (SRV) connection protocol, identified by the ``mongodb+srv`` connection string prefix.
159
-
|
160
-
| Throws an exception if you are not using the SRV connection protocol.
0 commit comments