Click or drag to resize

ClusterSettings.With Method

Returns a new ClusterSettings instance with some settings changed.

Namespace:  MongoDB.Driver.Core.Configuration
Assembly:  MongoDB.Driver.Core (in MongoDB.Driver.Core.dll) Version: 2.16.0+eeafbea0921243a5868b81984e1083a07c1f75bc
Syntax
public ClusterSettings With(
	Optional<ClusterConnectionMode> connectionMode = default,
	Optional<ConnectionModeSwitch> connectionModeSwitch = default,
	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
)

Parameters

connectionMode (Optional)
Type: MongoDB.Driver.Optional<ClusterConnectionMode>
The connection mode.
connectionModeSwitch (Optional)
Type: MongoDB.Driver.Optional<ConnectionModeSwitch>
The connection mode switch.
cryptClientSettings (Optional)
Type: MongoDB.Driver.Optional<CryptClientSettings>
[Beta] Crypt client settings.
directConnection (Optional)
Type: MongoDB.Driver.Optional<Nullable<Boolean>>
The directConnection.
endPoints (Optional)
Type: MongoDB.Driver.Optional<IEnumerable<EndPoint>>
The end points.
loadBalanced (Optional)
Type: MongoDB.Driver.Optional<Boolean>
The load balanced.
localThreshold (Optional)
Type: MongoDB.Driver.Optional<TimeSpan>
The local threshold.
maxServerSelectionWaitQueueSize (Optional)
Type: MongoDB.Driver.Optional<Int32>
Maximum size of the server selection wait queue.
replicaSetName (Optional)
Type: MongoDB.Driver.Optional<String>
Name of the replica set.
serverApi (Optional)
Type: MongoDB.Driver.Optional<ServerApi>
The server API.
serverSelectionTimeout (Optional)
Type: MongoDB.Driver.Optional<TimeSpan>
The server selection timeout.
preServerSelector (Optional)
Type: MongoDB.Driver.Optional<IServerSelector>
The pre server selector.
postServerSelector (Optional)
Type: MongoDB.Driver.Optional<IServerSelector>
The post server selector.
scheme (Optional)
Type: MongoDB.Driver.Optional<ConnectionStringScheme>
The connection string scheme.
srvMaxHosts (Optional)
Type: MongoDB.Driver.Optional<Int32>
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.

Return Value

Type: ClusterSettings
A new ClusterSettings instance.
See Also