UUIDCodingStrategy
public enum UUIDCodingStrategy : RawRepresentable
Enum representing the various encoding/decoding strategy pairs for Date
s.
Set these on a MongoClient
, MongoDatabase
, or MongoCollection
so that the strategies will be applied when
converting UUID
s between their BSON representations and their representations in (non BSONDocument
) Codable
types.
As per the BSON specification, the default strategy is to encode UUID
s as BSON binary types with the UUID
subtype.
See also
bsonspec.org-
Declaration
Swift
public typealias RawValue = (encoding: BSONEncoder.UUIDEncodingStrategy, decoding: BSONDecoder.UUIDDecodingStrategy)
-
Encode/decode the
UUID
by deferring to its default encoding/decoding implementations.Declaration
Swift
case deferredToUUID
-
Encode/decode the
UUID
to/from a BSON binary type (default).Declaration
Swift
case binary
-
Declaration
Swift
public init?(rawValue: RawValue)
-
Declaration
Swift
public var rawValue: RawValue { get }