struct Mongo::Options

Overview

A set of options used to configure the driver.

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

Included Modules

Defined in:

cryomongo/uri/options.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(**args) #

Instance Method Detail

def appname : String | Nil #

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


def auth_mechanism : String | Nil #

The authentication mechanism method to use for connection to the server


def auth_mechanism_properties : String | Nil #

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


def auth_source : String | Nil #

The database that connections should authenticate against


def auth_source=(auth_source : String | Nil) #

The database that connections should authenticate against


def compressors : String | Nil #

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


def connect_timeout : Time::Span | Nil #

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


def direct_connection : Bool | Nil #

Whether to connect to the deployment in Single topology.


def dns_resolver : DNS::Resolver | Nil #

Use custom dns resolver. Non-standard.

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


def heartbeat_frequency : Time::Span #

The interval between regular server monitoring checks


def heartbeat_frequency=(heartbeat_frequency : Time::Span) #

The interval between regular server monitoring checks


def journal : Bool | Nil #

Default write concern "j" field for the client


def local_threshold : Time::Span #

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


def max_idle_time : Time::Span | Nil #

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


def max_pool_size : Int32 #

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


def max_staleness_seconds : Int32 | Nil #

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


def min_pool_size : Int32 #

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


def mix_with_query_params(options_hash : HTTP::Params) #

def raw : HTTP::Params #

def raw? : HTTP::Params | Nil #

def read_concern_level : String | Nil #

Default read concern for the client


def read_preference : String | Nil #

Default read preference for the client (excluding tags)


def read_preference_tags : Array(String) #

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


def replica_set : String | Nil #

The name of the replica set to connect to


def replica_set=(replica_set : String | Nil) #

The name of the replica set to connect to


def retry_reads : Bool | Nil #

Enables retryable reads on server 3.6+


def retry_writes : Bool | Nil #

Enables retryable writes on server 3.6+


def server_selection_timeout : Time::Span #

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


def server_selection_timeout=(server_selection_timeout : Time::Span) #

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


def server_selection_try_once : Bool #

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


def 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


def socket_timeout : Time::Span | Nil #

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


def ssl : Bool | Nil #

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


def ssl=(ssl : Bool | Nil) #

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


def tls : Bool | Nil #

Whether or not to require TLS for connections to the server


def tls_allow_invalid_certificates : Bool | Nil #

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


def tls_allow_invalid_hostnames : Bool | Nil #

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


def tls_ca_file : String | Nil #

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


def tls_certificate_key_file : String | Nil #

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


def tls_certificate_key_file_password : String | Nil #

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


def tls_disable_certificate_revocation_check : Bool | Nil #

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.


def tls_disable_ocsp_endpoint_check : Bool | Nil #

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


def tls_insecure : Bool | Nil #

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


def validate(raw_hash) #

def w : Int32 | String | Nil #

Default write concern "w" field for the client


def w_timeout : Time::Span | Nil #

Default write concern "wtimeout" field for the client


def wait_queue_timeout : Time::Span | Nil #

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


def zlib_compression_level : Int32 | Nil #

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