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.15.0+f503bf610759c13f78cff9a3c01e91453185d2ed
Syntax public ClusterSettings With(
Optional<ClusterConnectionMode> connectionMode = default,
Optional<ConnectionModeSwitch> connectionModeSwitch = default,
Optional<bool?> directConnection = default,
Optional<IEnumerable<EndPoint>> endPoints = default,
Optional<IReadOnlyDictionary<string, IReadOnlyDictionary<string, Object>>> kmsProviders = 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<IReadOnlyDictionary<string, BsonDocument>> schemaMap = default,
Optional<ConnectionStringScheme> scheme = default,
Optional<int> srvMaxHosts = default
)
Public Function With (
Optional connectionMode As Optional(Of ClusterConnectionMode) = Nothing,
Optional connectionModeSwitch As Optional(Of ConnectionModeSwitch) = Nothing,
Optional directConnection As Optional(Of Boolean?) = Nothing,
Optional endPoints As Optional(Of IEnumerable(Of EndPoint)) = Nothing,
Optional kmsProviders As Optional(Of IReadOnlyDictionary(Of String, IReadOnlyDictionary(Of String, Object))) = 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 schemaMap As Optional(Of IReadOnlyDictionary(Of String, BsonDocument)) = 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> *
?directConnection : Optional<Nullable<bool>> *
?endPoints : Optional<IEnumerable<EndPoint>> *
?kmsProviders : Optional<IReadOnlyDictionary<string, IReadOnlyDictionary<string, Object>>> *
?loadBalanced : Optional<bool> *
?localThreshold : Optional<TimeSpan> *
?maxServerSelectionWaitQueueSize : Optional<int> *
?replicaSetName : Optional<string> *
?serverApi : Optional<ServerApi> *
?serverSelectionTimeout : Optional<TimeSpan> *
?preServerSelector : Optional<IServerSelector> *
?postServerSelector : Optional<IServerSelector> *
?schemaMap : Optional<IReadOnlyDictionary<string, BsonDocument>> *
?scheme : Optional<ConnectionStringScheme> *
?srvMaxHosts : Optional<int>
(* Defaults:
let _connectionMode = defaultArg connectionMode new Optional<ClusterConnectionMode>()
let _connectionModeSwitch = defaultArg connectionModeSwitch new Optional<ConnectionModeSwitch>()
let _directConnection = defaultArg directConnection new Optional<Nullable<bool>>()
let _endPoints = defaultArg endPoints new Optional<IEnumerable<EndPoint>>()
let _kmsProviders = defaultArg kmsProviders new Optional<IReadOnlyDictionary<string, IReadOnlyDictionary<string, Object>>>()
let _loadBalanced = defaultArg loadBalanced new Optional<bool>()
let _localThreshold = defaultArg localThreshold new Optional<TimeSpan>()
let _maxServerSelectionWaitQueueSize = defaultArg maxServerSelectionWaitQueueSize new Optional<int>()
let _replicaSetName = defaultArg replicaSetName new Optional<string>()
let _serverApi = defaultArg serverApi new Optional<ServerApi>()
let _serverSelectionTimeout = defaultArg serverSelectionTimeout new Optional<TimeSpan>()
let _preServerSelector = defaultArg preServerSelector new Optional<IServerSelector>()
let _postServerSelector = defaultArg postServerSelector new Optional<IServerSelector>()
let _schemaMap = defaultArg schemaMap new Optional<IReadOnlyDictionary<string, BsonDocument>>()
let _scheme = defaultArg scheme new Optional<ConnectionStringScheme>()
let _srvMaxHosts = defaultArg srvMaxHosts new Optional<int>()
*)
-> ClusterSettings
Parameters
- connectionMode (Optional)
- Type: MongoDB.DriverOptionalClusterConnectionMode
The connection mode. - connectionModeSwitch (Optional)
- Type: MongoDB.DriverOptionalConnectionModeSwitch
The connection mode switch. - directConnection (Optional)
- Type: MongoDB.DriverOptionalNullableBoolean
The directConnection. - endPoints (Optional)
- Type: MongoDB.DriverOptionalIEnumerableEndPoint
The end points. - kmsProviders (Optional)
- Type: MongoDB.DriverOptionalIReadOnlyDictionaryString, IReadOnlyDictionaryString, Object
The kms providers. - 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. - schemaMap (Optional)
- Type: MongoDB.DriverOptionalIReadOnlyDictionaryString, BsonDocument
The schema map. - 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