ClientOptions
public struct ClientOptions : CodingStrategyProvider
Options to use when creating a MongoClient
.
-
Determines whether the client should retry supported write operations
Declaration
Swift
public let retryWrites: Bool?
-
Indicates whether this client should be set up to enable monitoring command and server discovery and monitoring events.
Declaration
Swift
public let 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 let readConcern: ReadConcern?
-
Specifies a ReadPreference to use for the client.
Declaration
Swift
public let readPreference: ReadPreference?
-
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 let writeConcern: WriteConcern?
-
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 let 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 let 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 let 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)