Table of Contents

Method With

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

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.

public ClusterSettings With(Optional<CryptClientSettings> cryptClientSettings = default, Optional<bool> directConnection = default, Optional<IEnumerable<EndPoint>> endPoints = default, Optional<bool> loadBalanced = default, Optional<TimeSpan> localThreshold = default, Optional<int> maxServerSelectionWaitQueueSize = default, Optional<string> replicaSetName = default, Optional<ServerApi> serverApi = default, Optional<TimeSpan> serverSelectionTimeout = default, Optional<IServerSelector> preServerSelector = default, Optional<IServerSelector> postServerSelector = default, Optional<ConnectionStringScheme> scheme = default, Optional<int> srvMaxHosts = default, Optional<string> srvServiceName = default)

Parameters

cryptClientSettings Optional<CryptClientSettings>

Crypt client settings.

directConnection Optional<bool>

The directConnection.

endPoints Optional<IEnumerable<EndPoint>>

The end points.

loadBalanced Optional<bool>

The load balanced.

localThreshold Optional<TimeSpan>

The local threshold.

maxServerSelectionWaitQueueSize Optional<int>

Maximum size of the server selection wait queue.

replicaSetName Optional<string>

Name of the replica set.

serverApi Optional<ServerApi>

The server API.

serverSelectionTimeout Optional<TimeSpan>

The server selection timeout.

preServerSelector Optional<IServerSelector>

The pre server selector.

postServerSelector Optional<IServerSelector>

The post server selector.

scheme Optional<ConnectionStringScheme>

The connection string scheme.

srvMaxHosts Optional<int>

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 Optional<string>

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

_{srvServiceName}._tcp.{hostname}.{domainname}
Defaults to "mongodb".

Returns

ClusterSettings

A new ClusterSettings instance.