Click or drag to resize

ConnectionSettingsWith Method

Returns a new ConnectionSettings instance with some settings changed.

Namespace:  MongoDB.Driver.Core.Configuration
Assembly:  MongoDB.Driver.Core (in MongoDB.Driver.Core.dll) Version: 2.17.0+b316340e6cc3a8bfc8638dc31b54fbbfe41bfcb2
Syntax
public ConnectionSettings With(
	Optional<IEnumerable<IAuthenticatorFactory>> authenticatorFactories = default,
	Optional<IEnumerable<CompressorConfiguration>> compressors = default,
	Optional<bool> loadBalanced = default,
	Optional<TimeSpan> maxIdleTime = default,
	Optional<TimeSpan> maxLifeTime = default,
	Optional<string> applicationName = default
)

Parameters

authenticatorFactories (Optional)
Type: MongoDB.DriverOptionalIEnumerableIAuthenticatorFactory
The authenticator factories.
compressors (Optional)
Type: MongoDB.DriverOptionalIEnumerableCompressorConfiguration
The compressors.
loadBalanced (Optional)
Type: MongoDB.DriverOptionalBoolean
Whether the load balanced mode is enabled.
maxIdleTime (Optional)
Type: MongoDB.DriverOptionalTimeSpan
The maximum idle time.
maxLifeTime (Optional)
Type: MongoDB.DriverOptionalTimeSpan
The maximum life time.
applicationName (Optional)
Type: MongoDB.DriverOptionalString
The application name.

Return Value

Type: ConnectionSettings
A new ConnectionSettings instance.
See Also