@@ -76,12 +76,12 @@ Since the URI options are required in camel case, which is not the Ruby standard
76
76
following table shows the option in the URI and its corresponding option if passed
77
77
to the constructor in Ruby.
78
78
79
- .. note::
80
-
79
+ .. note::
80
+
81
81
The options passed directly should be symbols.
82
82
83
83
The options are explained in detail in the :manual:`Connection URI reference
84
- </reference/connection-string/>`.
84
+ </reference/connection-string/>`.
85
85
86
86
.. note::
87
87
Options that are set in **milliseconds** in the URI are
@@ -97,8 +97,20 @@ URI Options Conversions
97
97
* - URI Option
98
98
- Ruby Option
99
99
100
- * - replicaSet=String
101
- - ``:replica_set => String``
100
+ * - appName=String
101
+ - ``:app_name => String``
102
+
103
+ * - authMechanism=String
104
+ - ``:auth_mech => Symbol``
105
+
106
+ * - authMechanismProperties=Strings
107
+ - ``{ :auth_mech_properties => { :service_realm => String, :canonicalize_host_name => true|false, :service_name => String } }``
108
+
109
+ * - authSource=String
110
+ - ``:auth_source => String``
111
+
112
+ * - compressors=Strings
113
+ - ``:compressors => Array<String>``
102
114
103
115
* - connect=String
104
116
- ``:connect => Symbol``
@@ -109,11 +121,11 @@ URI Options Conversions
109
121
* - connectTimeoutMS=Integer
110
122
- ``:connect_timeout => Float``
111
123
112
- * - socketTimeoutMS=Integer
113
- - ``:socket_timeout => Float ``
124
+ * - fsync=Boolean
125
+ - ``{ :write => { :fsync => true|false }} ``
114
126
115
- * - serverSelectionTimeoutMS=Integer
116
- - ``:server_selection_timeout => Float ``
127
+ * - journal=Boolean
128
+ - ``{ :write => { :j => true|false }} ``
117
129
118
130
* - localThresholdMS=Integer
119
131
- ``:local_threshold => Float``
@@ -124,41 +136,29 @@ URI Options Conversions
124
136
* - minPoolSize=Integer
125
137
- ``:min_pool_size => Integer``
126
138
127
- * - waitQueueTimeoutMS=Integer
128
- - ``:wait_queue_timeout => Float``
129
-
130
- * - w=Integer|String
131
- - ``{ :write => { :w => Integer|String }}``
132
-
133
- * - wtimeoutMS=Integer
134
- - ``{ :write => { :wtimeout => Float }}``
135
-
136
- * - journal=Boolean
137
- - ``{ :write => { :j => true|false }}``
138
-
139
- * - fsync=Boolean
140
- - ``{ :write => { :fsync => true|false }}``
141
-
142
139
* - readPreference=String
143
140
- ``{ :read => { :mode => Symbol }}``
144
141
145
142
* - readPreferenceTags=Strings
146
143
- ``{ :read => { :tag_sets => Array<String> }}``
147
144
148
- * - authSource =String
149
- - ``:auth_source => String``
145
+ * - replicaSet =String
146
+ - ``:replica_set => String``
150
147
151
- * - authMechanism=String
152
- - ``:auth_mech => Symbol ``
148
+ * - serverSelectionTimeoutMS=Integer
149
+ - ``:server_selection_timeout => Float ``
153
150
154
- * - authMechanismProperties=Strings
155
- - ``{ :auth_mech_properties => { :service_realm => String, :canonicalize_host_name => true|false, :service_name => String } } ``
151
+ * - socketTimeoutMS=Integer
152
+ - ``:socket_timeout => Float ``
156
153
157
- * - appName= String
158
- - ``:app_name => String``
154
+ * - w=Integer| String
155
+ - ``{ :write => { :w => Integer| String }} ``
159
156
160
- * - compressors=Strings
161
- - ``:compressors => Array<String>``
157
+ * - waitQueueTimeoutMS=Integer
158
+ - ``:wait_queue_timeout => Float``
159
+
160
+ * - wtimeoutMS=Integer
161
+ - ``{ :write => { :wtimeout => Float }}``
162
162
163
163
* - zlibCompressionLevel=Integer
164
164
- ``:zlib_compression_level => Integer``
@@ -178,12 +178,12 @@ Ruby Options
178
178
179
179
* - ``:replica_set``
180
180
- When connecting to a replica set, this is the name of the set to
181
- filter servers by.
181
+ filter servers by.
182
182
- ``String``
183
183
- none
184
184
185
185
* - ``:ssl``
186
- - Tell the client to connect to the servers via SSL.
186
+ - Tell the client to connect to the servers via SSL.
187
187
- ``Boolean``
188
188
- false
189
189
@@ -255,30 +255,30 @@ Ruby Options
255
255
256
256
* - ``:connect_timeout``
257
257
- The number of seconds to wait to establish a socket connection
258
- before raising an exception.
258
+ before raising an exception.
259
259
- ``Float``
260
260
- 10 seconds
261
261
262
262
* - ``:socket_timeout``
263
263
- The number of seconds to wait for an operation to execute on a
264
- socket before raising an exception.
264
+ socket before raising an exception.
265
265
- ``Float``
266
266
- 5 seconds
267
267
268
268
* - ``:max_pool_size``
269
- - The maximum size of the connection pool for each server.
269
+ - The maximum size of the connection pool for each server.
270
270
- ``Integer``
271
271
- 5
272
272
273
273
* - ``:min_pool_size``
274
274
- The minimum number of connections in the connection pool for each
275
- server.
275
+ server.
276
276
- ``Integer``
277
277
- 1
278
278
279
279
* - ``:wait_queue_timeout``
280
280
- The number of seconds to wait for a connection in the connection
281
- pool to become available.
281
+ pool to become available.
282
282
- ``Float``
283
283
- 1
284
284
@@ -291,22 +291,22 @@ Ruby Options
291
291
{ :write => { :w => 2 } }
292
292
- ``Hash``
293
293
- ``{ :w => 1 }``
294
-
294
+
295
295
* - ``:read``
296
296
- Specifies the read preference mode and tag sets for selecting servers as a ``Hash``.
297
297
Keys in the hash are ``:mode`` and ``:tag_sets``.
298
298
299
299
.. code-block:: ruby
300
300
301
- { :read =>
302
- { :mode => :secondary,
303
- :tag_sets => [ "berlin" ]
304
- }
301
+ { :read =>
302
+ { :mode => :secondary,
303
+ :tag_sets => [ "berlin" ]
304
+ }
305
305
}
306
306
307
307
- ``Hash``
308
308
- ``{ :mode => :primary }``
309
-
309
+
310
310
* - ``:auth_source``
311
311
- Specifies the authentication source.
312
312
- ``String``
@@ -316,7 +316,7 @@ Ruby Options
316
316
317
317
* - ``:auth_mech``
318
318
- Specifies the authenticaion mechanism to use. Can be one of:
319
- ``:mongodb_cr``, ``:mongodb_x509``, ``:plain``, ``:scram``.
319
+ ``:mongodb_cr``, ``:mongodb_x509``, ``:plain``, ``:scram``.
320
320
- ``Symbol``
321
321
- MongoDB 3.0 and later: ``:scram`` if user credentials
322
322
are supplied but an ``:auth_mech`` is not. 2.6 and earlier:
@@ -343,7 +343,7 @@ Ruby Options
343
343
``:replica_set`` or ``:sharded``.
344
344
- ``Symbol``
345
345
- none
346
-
346
+
347
347
* - ``:heartbeat_frequency``
348
348
- The number of seconds for the server monitors to refresh
349
349
server states asynchronously.
@@ -437,9 +437,9 @@ Details on Timeout Options
437
437
438
438
``connect_timeout``
439
439
On initialization of a connection to a server, this setting is the
440
- number of seconds to wait to connect before raising an exception.
440
+ number of seconds to wait to connect before raising an exception.
441
441
This timeout is also used when monitor threads ping their servers.
442
- The default is 10 seconds. See the `socket timeout for monitoring
442
+ The default is 10 seconds. See the `socket timeout for monitoring
443
443
specification <https://github.com/mongodb/specifications/blob/
444
444
master/source/server-discovery-and-monitoring/server-discovery-and-monitoring.rst#socket-timeout-for-monitoring
445
445
-is-connecttimeoutms>`_ for further explanation.
@@ -457,7 +457,7 @@ Details on Timeout Options
457
457
The number of seconds to wait for the driver to find an appropriate server to
458
458
which an operation can be sent before raising an exception. Defaults to 30.
459
459
It should take the speed of :manual:`elections</core/replica-set-elections/>`
460
- during a failover into account. See the
460
+ during a failover into account. See the
461
461
`serverSelectionTimeoutMS specification
462
462
<https://github.com/mongodb/specifications/blob/master/source/server-selection/server-selection.rst#serverselectiontimeoutms>`_
463
463
for further information.
@@ -466,10 +466,10 @@ Details on Timeout Options
466
466
The maximum latency in seconds between the nearest server and the servers that can be considered available to send an
467
467
operation to. Defaults to 0.015.
468
468
469
- .. note::
469
+ .. note::
470
470
This is not the latency window between the driver and a server, but
471
471
rather the latency between the nearest server and other servers. See
472
- `the localThresholdMS specification
472
+ `the localThresholdMS specification
473
473
<https://github.com/mongodb/specifications/blob/master/source/server-selection/server-selection.rst#localthresholdms>`_.
474
474
475
475
``wait_queue_timeout``
@@ -483,7 +483,7 @@ Details on Timeout Options
483
483
484
484
``min_pool_size``
485
485
Minimum number of connections in the connection pool for each server.
486
- Increase this number to create connections when the pool is
486
+ Increase this number to create connections when the pool is
487
487
initialized and to reduce the overhead of creating new connections
488
488
later on. Defaults to 1.
489
489
@@ -669,7 +669,7 @@ You can either use the default global driver logger or set your own. To set your
669
669
Mongo::Logger.logger = other_logger
670
670
671
671
See the `Ruby Logger documentation <http://ruby-doc.org/stdlib-2.2.0/libdoc/logger/rdoc/Logger.html>`_
672
- for more information on the default logger API and available levels.
672
+ for more information on the default logger API and available levels.
673
673
674
674
Changing the Logger Level
675
675
`````````````````````````
0 commit comments