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.13.1-v2-13-x1+a7f8afe27855f38f4f72157d11ba2ae73895502e
Syntax
public ConnectionSettings With(
	Optional<IEnumerable<IAuthenticatorFactory>> authenticatorFactories = null,
	Optional<IEnumerable<CompressorConfiguration>> compressors = null,
	Optional<bool> loadBalanced = null,
	Optional<TimeSpan> maxIdleTime = null,
	Optional<TimeSpan> maxLifeTime = null,
	Optional<string> applicationName = null
)

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