ClientOptions
public struct ClientOptions : CodingStrategyProvider, Decodable
Options to use when creating a MongoClient
.
-
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?
-
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 a ReadConcern to use for the client.
Declaration
Swift
public var readConcern: ReadConcern?
-
Specifies a ReadPreference to use for the client.
Declaration
Swift
public var readPreference: ReadPreference?
-
Determines whether the client should retry supported read operations (on by default).
Declaration
Swift
public var retryReads: Bool?
-
Determines whether the client should retry supported write operations (on by default).
Declaration
Swift
public var retryWrites: Bool?
-
MongoSwift.MongoClient
provides an asynchronous API by running all blocking operations off of their originating threads in a thread pool.MongoSwiftSync.MongoClient
is implemented as a wrapper of the async client which waits for each corresponding asynchronous operation to complete and then returns the result. This option specifies the size of the thread pool used by the asynchronous client, and determines the max number of concurrent operations that may be performed using a single client.Declaration
Swift
public var threadPoolSize: Int?
-
Specifies the TLS/SSL options to use for database connections.
Declaration
Swift
public var tlsOptions: TLSOptions?
-
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 a WriteConcern to use for the client.
Declaration
Swift
public var writeConcern: WriteConcern?
-
init(dataCodingStrategy:dateCodingStrategy:readConcern:readPreference:retryReads:retryWrites:threadPoolSize:tlsOptions:uuidCodingStrategy:writeConcern:)
Convenience initializer allowing any/all to be omitted or optional.
Declaration
Swift
public init( dataCodingStrategy: DataCodingStrategy? = nil, dateCodingStrategy: DateCodingStrategy? = nil, readConcern: ReadConcern? = nil, readPreference: ReadPreference? = nil, retryReads: Bool? = nil, retryWrites: Bool? = nil, threadPoolSize: Int = MongoClient.defaultThreadPoolSize, tlsOptions: TLSOptions? = nil, uuidCodingStrategy: UUIDCodingStrategy? = nil, writeConcern: WriteConcern? = nil )