Skip to content

Commit 9176b72

Browse files
committed
Fix Mongo::Client options documentation
1 parent 3c3422e commit 9176b72

File tree

2 files changed

+62
-2
lines changed

2 files changed

+62
-2
lines changed

docs/tutorials/ruby-driver-create-client.txt

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,63 @@ Ruby Options
349349
- ``Float``
350350
- 0.015
351351

352+
* - ``:app_name``
353+
- Application name that is printed to the mongod logs upon establishing a connection
354+
in server versions >= 3.4.
355+
- ``String``
356+
- none
357+
358+
* - ``:compressors``
359+
- A list of potential compressors to use, in order of preference. The driver chooses the first
360+
compressor that is also supported by the server. Currently the driver only supports 'zlib'.
361+
- ``Array<String>``
362+
- none
363+
364+
* - ``:id_generator``
365+
- A custom object to generate ids for documents. Must respond to #generate.
366+
- ``Object``
367+
- none
368+
369+
* - ``:logger``
370+
- A custom logger.
371+
- ``Object``
372+
- ``Logger``
373+
374+
* - ``:max_idle_time``
375+
- The maximum seconds a socket can remain idle since it has been checked in to the pool.
376+
- ``Integer``
377+
- none
378+
379+
* - ``:max_read_retries``
380+
- The maximum number of read retries on mongos query failures.
381+
- ``Integer``
382+
- 1
383+
384+
* - ``:monitoring``
385+
- The monitoring object.
386+
- ``Object``
387+
- none
388+
389+
* - ``:platform``
390+
- Platform information to include in the metadata printed to the mongod logs upon establishing a
391+
connection in server versions >= 3.4.
392+
- ``String``
393+
- none
394+
395+
* - ``:read_retry_interval``
396+
- The interval, in seconds, in which reads on a mongos are retried.
397+
- ``Integer``
398+
- 5
399+
400+
* - ``:truncate_logs``
401+
- Whether to truncate the logs at the default 250 characters.
402+
- ``Boolean``
403+
- true
404+
405+
* - ``:zlib_compression_level``
406+
- The Zlib compression level to use, if using compression. See Ruby's Zlib module for valid levels.
407+
- ``Integer``
408+
- none
352409

353410

354411
Details on Timeout Options

lib/mongo/client.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,9 @@ def hash
178178
# seconds, in the connection pool for a connection to be checked in.
179179
# @option options [ Float ] :connect_timeout The timeout, in seconds, to
180180
# attempt a connection.
181-
# @option options [ Array<String> ] :compressors The compressor to use. Currently the driver
182-
# only supports zlib.
181+
# @option options [ Array<String> ] :compressors A list of potential compressors to use, in order of preference.
182+
# The driver chooses the first compressor that is also supported by the server. Currently the driver only
183+
# supports 'zlib'.
183184
# @option options [ Hash ] :read The read preference options. They consist of a
184185
# mode specified as a symbol, an array of hashes known as tag_sets,
185186
# and local_threshold.
@@ -240,6 +241,8 @@ def hash
240241
# mongod logs upon establishing a connection in server versions >= 3.4.
241242
# @option options [ String ] :platform Platform information to include in the
242243
# metadata printed to the mongod logs upon establishing a connection in server versions >= 3.4.
244+
# @option options [ Integer ] :zlib_compression_level The Zlib compression level to use, if using compression.
245+
# See Ruby's Zlib module for valid levels.
243246
# @option options [ true, false ] :retry_writes Retry writes once when connected to a replica set
244247
# or sharded cluster versions 3.6 and up.
245248
#

0 commit comments

Comments
 (0)