struct

Mongo::Options

Inherits Mongo::Tools::Initializer / Struct / Value / Object

A set of options used to configure the driver.

NOTE: For more details, see the uri options specification document.

Constructors

Instance methods

appname

Passed into the server in the client metadata as part of the connection handshake

Source
auth_mechanism

The authentication mechanism method to use for connection to the server

Source
auth_mechanism_properties

Additional options provided for authentication (e.g. to enable hostname canonicalization for GSSAPI)

Source
auth_source

The database that connections should authenticate against

Source
auth_source=(auth_source : String | Nil)

The database that connections should authenticate against

Source
compressors

The list of allowed compression types for wire protocol messages sent or received from the server

Source
connect_timeout

Amount of time to wait for a single TCP socket connection to the server to be established before erroring; note that this applies to SDAM isMaster operations

Source
direct_connection

Whether to connect to the deployment in Single topology.

Source
dns_resolver

Use custom dns resolver. Non-standard.

By default, the Cloudflare public DNS is used. (1.1.1.1)

Source
heartbeat_frequency

The interval between regular server monitoring checks

Source
heartbeat_frequency=(heartbeat_frequency : Time::Span)

The interval between regular server monitoring checks

Source
journal

Default write concern "j" field for the client

Source
local_threshold

The amount of time beyond the fastest round trip time that a given server’s round trip time can take and still be eligible for server selection

Source
max_idle_time

The amount of time a connection can be idle before it's closed

Source
max_pool_size

The maximum number of clients or connections able to be created by a pool at a given time

Source
max_staleness_seconds

The maximum replication lag, in wall clock time, that a secondary can suffer and still be eligible for server selection

Source
min_pool_size

The maximum number of clients or connections able to be created by a pool at a given time

Source
mix_with_query_params(options_hash : HTTP::Params)
Source
raw?
Source
read_concern_level

Default read concern for the client

Source
read_preference

Default read preference for the client (excluding tags)

Source
read_preference_tags

Default read preference tags for the client; only valid if the read preference mode is not primary

Source
replica_set

The name of the replica set to connect to

Source
replica_set=(replica_set : String | Nil)

The name of the replica set to connect to

Source
retry_reads

Enables retryable reads on server 3.6+

Source
retry_writes

Enables retryable writes on server 3.6+

Source
server_selection_timeout

A timeout in milliseconds to block for server selection before raising an error

Source
server_selection_timeout=(server_selection_timeout : Time::Span)

A timeout in milliseconds to block for server selection before raising an error

Source
server_selection_try_once

Scan the topology only once after a server selection failure instead of repeatedly until the server selection times out

Source
server_selection_try_once=(server_selection_try_once : Bool)

Scan the topology only once after a server selection failure instead of repeatedly until the server selection times out

Source
socket_timeout

Amount of time spent attempting to send or receive on a socket before timing out; note that this only applies to application operations, not SDAM

Source
ssl

Alias of "tls"; required to ensure that Atlas connection strings continue to work

Source
ssl=(ssl : Bool | Nil)

Alias of "tls"; required to ensure that Atlas connection strings continue to work

Source
tls

Whether or not to require TLS for connections to the server

Source
tls_allow_invalid_certificates

Specifies whether or not the driver should error when the server’s TLS certificate is invalid

Source
tls_allow_invalid_hostnames

Specifies whether or not the driver should error when there is a mismatch between the server’s hostname and the hostname specified by the TLS certificate

Source
tls_ca_file

Path to file with either a single or bundle of certificate authorities to be considered trusted when making a TLS connection

Source
tls_certificate_key_file

Path to the client certificate file or the client private key file; in the case that they both are needed, the files should be concatenated

Source
tls_certificate_key_file_password

Password to decrypt the client private key to be used for TLS connections

Source
tls_disable_certificate_revocation_check

Controls whether or not the driver will check a certificate's revocation status via CRLs or OCSP. See the OCSP Support Spec for additional information.

Source
tls_disable_ocsp_endpoint_check

Controls whether or not the driver will reach out to OCSP endpoints if needed. See the OCSP Support Spec for additional information.

Source
tls_insecure

Relax TLS constraints as much as possible (e.g. allowing invalid certificates or hostname mismatches); drivers must document the exact constraints which are relaxed by this option being true

Source
validate(raw_hash)
Source
w

Default write concern "w" field for the client

Source
w_timeout

Default write concern "wtimeout" field for the client

Source
wait_queue_timeout

The maximum amount of time a fiber can wait for a connection to become available

Source
zlib_compression_level

Specifies the level of compression when using zlib to compress wire protocol messages; -1 signifies the default level, 0 signifies no compression, 1 signifies the fastest speed, and 9 signifies the best compression

Source