CollectionOptions
public struct CollectionOptions : CodingStrategyProvider
Options to set on a retrieved MongoCollection
.
-
A read concern to set on the returned collection. If one is not specified, the collection will inherit the database’s read concern.
Declaration
Swift
public let readConcern: ReadConcern?
-
A read preference to set on the returned collection. If one is not specified, the collection will inherit the database’s read preference.
Declaration
Swift
public let readPreference: ReadPreference?
-
A write concern to set on the returned collection. If one is not specified, the collection will inherit the database’s write concern.
Declaration
Swift
public let writeConcern: WriteConcern?
-
Specifies the
DateCodingStrategy
to use for BSON encoding/decoding operations performed by this collection. It is the responsibility of the user to ensure that anyDate
s already stored in this collection can be decoded using this strategy.Declaration
Swift
public let dateCodingStrategy: DateCodingStrategy?
-
Specifies the
UUIDCodingStrategy
to use for BSON encoding/decoding operations performed by this collection. It is the responsibility of the user to ensure that anyUUID
s already stored in this collection can be decoded using this strategy.Declaration
Swift
public let uuidCodingStrategy: UUIDCodingStrategy?
-
Specifies the
DataCodingStrategy
to use for BSON encoding/decoding operations performed by this collection. It is the responsibility of the user to ensure that anyData
s already stored in this collection can be decoded using this strategy.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)