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) #

[View source]

Instance Method Detail

def appname : String | Nil #

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


[View source]
def auth_mechanism : String | Nil #

The authentication mechanism method to use for connection to the server


[View source]
def auth_mechanism_properties : String | Nil #

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


[View source]
def auth_source : String | Nil #

The database that connections should authenticate against


[View source]
def auth_source=(auth_source : String | Nil) #

The database that connections should authenticate against


[View source]
def compressors : String | Nil #

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


[View source]
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


[View source]
def direct_connection : Bool | Nil #

Whether to connect to the deployment in Single topology.


[View source]
def dns_resolver : DNS::Resolver | Nil #

Use custom dns resolver. Non-standard.

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


[View source]
def heartbeat_frequency : Time::Span #

The interval between regular server monitoring checks


[View source]
def heartbeat_frequency=(heartbeat_frequency : Time::Span) #

The interval between regular server monitoring checks


[View source]
def journal : Bool | Nil #

Default write concern "j" field for the client


[View source]
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


[View source]
def max_idle_time : Time::Span | Nil #

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


[View source]
def max_pool_size : Int32 #

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


[View source]
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


[View source]
def min_pool_size : Int32 #

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


[View source]
def mix_with_query_params(options_hash : HTTP::Params) #

[View source]
def raw : HTTP::Params #

[View source]
def raw? : HTTP::Params | Nil #

[View source]
def read_concern_level : String | Nil #

Default read concern for the client


[View source]
def read_preference : String | Nil #

Default read preference for the client (excluding tags)


[View source]
def read_preference_tags : Array(String) #

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


[View source]
def replica_set : String | Nil #

The name of the replica set to connect to


[View source]
def replica_set=(replica_set : String | Nil) #

The name of the replica set to connect to


[View source]
def retry_reads : Bool | Nil #

Enables retryable reads on server 3.6+


[View source]
def retry_writes : Bool | Nil #

Enables retryable writes on server 3.6+


[View source]
def server_selection_timeout : Time::Span #

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


[View source]
def server_selection_timeout=(server_selection_timeout : Time::Span) #

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


[View source]
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


[View source]
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


[View source]
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


[View source]
def ssl : Bool | Nil #

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


[View source]
def ssl=(ssl : Bool | Nil) #

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


[View source]
def tls : Bool | Nil #

Whether or not to require TLS for connections to the server


[View source]
def tls_allow_invalid_certificates : Bool | Nil #

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


[View source]
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


[View source]
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


[View source]
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


[View source]
def tls_certificate_key_file_password : String | Nil #

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


[View source]
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.


[View source]
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.


[View source]
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


[View source]
def validate(raw_hash) #

[View source]
def w : Int32 | String | Nil #

Default write concern "w" field for the client


[View source]
def w_timeout : Time::Span | Nil #

Default write concern "wtimeout" field for the client


[View source]
def wait_queue_timeout : Time::Span | Nil #

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


[View source]
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


[View source]