DatabaseOptions
public struct DatabaseOptions : CodingStrategyProvider
Options to use when retrieving a MongoDatabase
from a MongoClient
.
-
A read concern to set on the retrieved database. If one is not specified, the database will inherit the client’s read concern.
Declaration
Swift
public let readConcern: ReadConcern?
-
A read preference to set on the retrieved database. If one is not specified, the database will inherit the client’s read preference.
Declaration
Swift
public let readPreference: ReadPreference?
-
A write concern to set on the retrieved database. If one is not specified, the database will inherit the client’s write concern.
Declaration
Swift
public let writeConcern: WriteConcern?
-
Specifies the
DateCodingStrategy
to use for BSON encoding/decoding operations performed by this database and any collections that derive from it.Declaration
Swift
public let dateCodingStrategy: DateCodingStrategy?
-
Specifies the
DateCodingStrategy
to use for BSON encoding/decoding operations performed by this database and any collections that derive from it.Declaration
Swift
public let uuidCodingStrategy: UUIDCodingStrategy?
-
Specifies the
DateCodingStrategy
to use for BSON encoding/decoding operations performed by this database and any collections that derive from it.Declaration
Swift
public let dataCodingStrategy: DataCodingStrategy?
-
init(readConcern:readPreference:writeConcern:dateCodingStrategy:uuidCodingStrategy:dataCodingStrategy:)
Convenience initializer allowing any/all arguments to be omitted or optional
Declaration
Swift
public init(readConcern: ReadConcern? = nil, readPreference: ReadPreference? = nil, writeConcern: WriteConcern? = nil, dateCodingStrategy: DateCodingStrategy? = nil, uuidCodingStrategy: UUIDCodingStrategy? = nil, dataCodingStrategy: DataCodingStrategy? = nil)