Table of Contents

Class ClusterSettings

Namespace
MongoDB.Driver.Core.Configuration
Assembly
MongoDB.Driver.dll

Represents settings for a cluster.

public class ClusterSettings
Inheritance
ClusterSettings
Inherited Members

Constructors

ClusterSettings(Optional<CryptClientSettings>, Optional<bool>, Optional<IEnumerable<EndPoint>>, Optional<bool>, Optional<TimeSpan>, Optional<int>, Optional<string>, Optional<ServerApi>, Optional<TimeSpan>, Optional<IServerSelector>, Optional<IServerSelector>, Optional<ConnectionStringScheme>, Optional<int>, Optional<string>)

Initializes a new instance of the ClusterSettings class.

Properties

CryptClientSettings

Gets the crypt client settings.

DirectConnection

Gets the DirectConnection.

EndPoints

Gets the end points.

LoadBalanced

Gets whether to use load balanced.

LocalThreshold

Gets the local threshold.

MaxServerSelectionWaitQueueSize

Gets the maximum size of the server selection wait queue.

PostServerSelector

Gets the post server selector.

PreServerSelector

Gets the pre server selector.

ReplicaSetName

Gets the name of the replica set.

Scheme

Gets the connection string scheme.

ServerApi

Gets the server API.

ServerSelectionTimeout

Gets the server selection timeout.

SrvAllowedHostsSuffix

Gets the hostname suffix that hosts returned by an SRV lookup are validated against. When set, it replaces the domain name that would otherwise be inferred from the SRV hostname.

WARNING: Modifying the default SRV domain name validation can create vulnerabilities. Prefer the narrowest suffix that covers the deployment: the broader it is, the more hosts a forged SRV response could direct the driver to.

SrvMaxHosts

Limits the number of SRV records used to populate the seedlist during initial discovery, as well as the number of additional hosts that may be added during SRV polling.

SrvServiceName

Gets the SRV service name which modifies the srv URI to look like:

_{srvServiceName}._tcp.{hostname}.{domainname}

The default value is "mongodb".

Methods

With(Optional<CryptClientSettings>, Optional<bool>, Optional<IEnumerable<EndPoint>>, Optional<bool>, Optional<TimeSpan>, Optional<int>, Optional<string>, Optional<ServerApi>, Optional<TimeSpan>, Optional<IServerSelector>, Optional<IServerSelector>, Optional<ConnectionStringScheme>, Optional<int>, Optional<string>)

Returns a new ClusterSettings instance with some settings changed.

WithSrvAllowedHostsSuffix(string)

Returns a new ClusterSettings instance with the SRV allowed hosts suffix changed.