ClusterSettingsWith 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.20.0+ee01960089f28ea1b501690df5fc9f6318a70242
Syntax public ClusterSettings With(
Optional<ClusterConnectionMode> connectionMode = null,
Optional<ConnectionModeSwitch> connectionModeSwitch = null,
Optional<CryptClientSettings> cryptClientSettings = null,
Optional<Nullable<bool>> directConnection = null,
Optional<IEnumerable<EndPoint>> endPoints = null,
Optional<bool> loadBalanced = null,
Optional<TimeSpan> localThreshold = null,
Optional<int> maxServerSelectionWaitQueueSize = null,
Optional<string> replicaSetName = null,
Optional<ServerApi> serverApi = null,
Optional<TimeSpan> serverSelectionTimeout = null,
Optional<IServerSelector> preServerSelector = null,
Optional<IServerSelector> postServerSelector = null,
Optional<ConnectionStringScheme> scheme = null,
Optional<int> srvMaxHosts = null
)
Public Function With (
Optional connectionMode As Optional(Of ClusterConnectionMode) = Nothing,
Optional connectionModeSwitch As Optional(Of ConnectionModeSwitch) = Nothing,
Optional cryptClientSettings As Optional(Of CryptClientSettings) = Nothing,
Optional directConnection As Optional(Of Nullable(Of Boolean)) = Nothing,
Optional endPoints As Optional(Of IEnumerable(Of EndPoint)) = Nothing,
Optional loadBalanced As Optional(Of Boolean) = Nothing,
Optional localThreshold As Optional(Of TimeSpan) = Nothing,
Optional maxServerSelectionWaitQueueSize As Optional(Of Integer) = Nothing,
Optional replicaSetName As Optional(Of String) = Nothing,
Optional serverApi As Optional(Of ServerApi) = Nothing,
Optional serverSelectionTimeout As Optional(Of TimeSpan) = Nothing,
Optional preServerSelector As Optional(Of IServerSelector) = Nothing,
Optional postServerSelector As Optional(Of IServerSelector) = Nothing,
Optional scheme As Optional(Of ConnectionStringScheme) = Nothing,
Optional srvMaxHosts As Optional(Of Integer) = Nothing
) As ClusterSettings
member With :
?connectionMode : Optional<ClusterConnectionMode> *
?connectionModeSwitch : Optional<ConnectionModeSwitch> *
?cryptClientSettings : Optional<CryptClientSettings> *
?directConnection : Optional<Nullable<bool>> *
?endPoints : Optional<IEnumerable<EndPoint>> *
?loadBalanced : Optional<bool> *
?localThreshold : Optional<TimeSpan> *
?maxServerSelectionWaitQueueSize : Optional<int> *
?replicaSetName : Optional<string> *
?serverApi : Optional<ServerApi> *
?serverSelectionTimeout : Optional<TimeSpan> *
?preServerSelector : Optional<IServerSelector> *
?postServerSelector : Optional<IServerSelector> *
?scheme : Optional<ConnectionStringScheme> *
?srvMaxHosts : Optional<int>
(* Defaults:
let _connectionMode = defaultArg connectionMode null
let _connectionModeSwitch = defaultArg connectionModeSwitch null
let _cryptClientSettings = defaultArg cryptClientSettings null
let _directConnection = defaultArg directConnection null
let _endPoints = defaultArg endPoints null
let _loadBalanced = defaultArg loadBalanced null
let _localThreshold = defaultArg localThreshold null
let _maxServerSelectionWaitQueueSize = defaultArg maxServerSelectionWaitQueueSize null
let _replicaSetName = defaultArg replicaSetName null
let _serverApi = defaultArg serverApi null
let _serverSelectionTimeout = defaultArg serverSelectionTimeout null
let _preServerSelector = defaultArg preServerSelector null
let _postServerSelector = defaultArg postServerSelector null
let _scheme = defaultArg scheme null
let _srvMaxHosts = defaultArg srvMaxHosts null
*)
-> ClusterSettings
Parameters
- connectionMode (Optional)
- Type: MongoDB.DriverOptionalClusterConnectionMode
The connection mode. - connectionModeSwitch (Optional)
- Type: MongoDB.DriverOptionalConnectionModeSwitch
The connection mode switch. - cryptClientSettings (Optional)
- Type: MongoDB.DriverOptionalCryptClientSettings
Crypt client settings. - directConnection (Optional)
- Type: MongoDB.DriverOptionalNullableBoolean
The directConnection. - endPoints (Optional)
- Type: MongoDB.DriverOptionalIEnumerableEndPoint
The end points. - loadBalanced (Optional)
- Type: MongoDB.DriverOptionalBoolean
The load balanced. - localThreshold (Optional)
- Type: MongoDB.DriverOptionalTimeSpan
The local threshold. - maxServerSelectionWaitQueueSize (Optional)
- Type: MongoDB.DriverOptionalInt32
Maximum size of the server selection wait queue. - replicaSetName (Optional)
- Type: MongoDB.DriverOptionalString
Name of the replica set. - serverApi (Optional)
- Type: MongoDB.DriverOptionalServerApi
The server API. - serverSelectionTimeout (Optional)
- Type: MongoDB.DriverOptionalTimeSpan
The server selection timeout. - preServerSelector (Optional)
- Type: MongoDB.DriverOptionalIServerSelector
The pre server selector. - postServerSelector (Optional)
- Type: MongoDB.DriverOptionalIServerSelector
The post server selector. - scheme (Optional)
- Type: MongoDB.DriverOptionalConnectionStringScheme
The connection string scheme. - srvMaxHosts (Optional)
- Type: MongoDB.DriverOptionalInt32
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:
ClusterSettingsA new ClusterSettings instance.
See Also