ClientOptions
public struct ClientOptions : CodingStrategyProvider, Decodable
Options to use when creating a MongoClient
.
-
Determines whether the client should retry supported write operations.
Declaration
Swift
public var retryWrites: Bool?
-
Indicates whether this client should be set up to enable monitoring command and server discovery and monitoring events.
Declaration
Swift
public var eventMonitoring: Bool
-
Specifies a ReadConcern to use for the client. If one is not specified, the server’s default read concern will be used.
Declaration
Swift
public var readConcern: ReadConcern?
-
Specifies a WriteConcern to use for the client. If one is not specified, the server’s default write concern will be used.
Declaration
Swift
public var writeConcern: WriteConcern?
-
Specifies a ReadPreference to use for the client.
Declaration
Swift
public var readPreference: ReadPreference?
-
Specifies the
DateCodingStrategy
to use for BSON encoding/decoding operations performed by this client and any databases or collections that derive from it.Declaration
Swift
public var dateCodingStrategy: DateCodingStrategy?
-
Specifies the
UUIDCodingStrategy
to use for BSON encoding/decoding operations performed by this client and any databases or collections that derive from it.Declaration
Swift
public var uuidCodingStrategy: UUIDCodingStrategy?
-
Specifies the
DataCodingStrategy
to use for BSON encoding/decoding operations performed by this client and any databases or collections that derive from it.Declaration
Swift
public var dataCodingStrategy: DataCodingStrategy?
-
init(eventMonitoring:readConcern:readPreference:retryWrites:writeConcern:dateCodingStrategy:uuidCodingStrategy:dataCodingStrategy:)
Convenience initializer allowing any/all to be omitted or optional.
Declaration
Swift
public init(eventMonitoring: Bool = false, readConcern: ReadConcern? = nil, readPreference: ReadPreference? = nil, retryWrites: Bool? = nil, writeConcern: WriteConcern? = nil, dateCodingStrategy: DateCodingStrategy? = nil, uuidCodingStrategy: UUIDCodingStrategy? = nil, dataCodingStrategy: DataCodingStrategy? = nil)