client_options – Read only configuration options for a MongoClient. (original) (raw)

Back to top

View this page

Toggle table of contents sidebar

Tools to parse mongo client options.

See also

This module is compatible with both the synchronous and asynchronous PyMongo APIs.

class pymongo.client_options.ClientOptions

Read only configuration options for an AsyncMongoClient/MongoClient.

Should not be instantiated directly by application developers. Access a client’s options via pymongo.mongo_client.AsyncMongoClient.options or pymongo.mongo_client.MongoClient.optionsinstead.

Parameters:

property auto_encryption_opts_: AutoEncryptionOpts | None_

A AutoEncryptionOpts or None.

property codec_options_: CodecOptions_

A CodecOptions instance.

property connect_: bool | None_

Whether to begin discovering a MongoDB topology automatically.

property direct_connection_: bool | None_

Whether to connect to the deployment in ‘Single’ topology.

property event_listeners_: list[_EventListeners]_

The event listeners registered for this client.

See monitoring for details.

Added in version 4.0.

property heartbeat_frequency_: int_

The monitoring frequency in seconds.

property load_balanced_: bool | None_

True if the client was configured to connect to a load balancer.

property local_threshold_ms_: int_

The local threshold for this instance.

property pool_options_: PoolOptions_

A PoolOptions instance.

property read_concern_: ReadConcern_

A ReadConcern instance.

property read_preference_: _ServerMode_

A read preference instance.

property replica_set_name_: str | None_

Replica set name or None.

property retry_reads_: bool_

If this instance should retry supported read operations.

property retry_writes_: bool_

If this instance should retry supported write operations.

property server_monitoring_mode_: str_

The configured serverMonitoringMode option.

Added in version 4.5.

property server_selection_timeout_: int_

The server selection timeout for this instance in seconds.

property timeout_: float | None_

The configured timeoutMS converted to seconds, or None.

Added in version 4.2.

property write_concern_: WriteConcern_

A WriteConcern instance.