Encoding and Decoding BSON
-
See moreBSONEncoder
facilitates the encoding ofEncodable
values into BSON.Declaration
Swift
public class BSONEncoder
-
See moreBSONDecoder
facilitates the decoding of BSON into semanticDecodable
types.Declaration
Swift
public class BSONDecoder
-
Enum representing the various encoding/decoding strategy pairs for
Date
s. Set these on aMongoClient
,MongoDatabase
, orMongoCollection
so that the strategies will be applied when convertingData
s between their BSON representations and their representations in (nonBSONDocument
)Codable
types.As per the BSON specification, the default strategy is to encode
Data
s as BSON binary types with the generic binary subtype.See also
bsonspec.orgDeclaration
Swift
public enum DataCodingStrategy : RawRepresentable
-
Enum representing the various encoding/decoding strategy pairs for
Date
s. Set these on aMongoClient
,MongoDatabase
, orMongoCollection
so that the strategies will be applied when convertingDate
s between their BSON representations and their representations in (nonBSONDocument
)Codable
types.As per the BSON specification, the default strategy is to encode
Date
s as BSON datetime objects.See also
bsonspec.orgDeclaration
Swift
public enum DateCodingStrategy : RawRepresentable
-
Enum representing the various encoding/decoding strategy pairs for
Date
s. Set these on aMongoClient
,MongoDatabase
, orMongoCollection
so that the strategies will be applied when convertingUUID
s between their BSON representations and their representations in (nonBSONDocument
)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.orgDeclaration
Swift
public enum UUIDCodingStrategy : RawRepresentable
-
Protocol indicating a set of options can be used to configure
See moreBSONEncoder
andBSONDecoder
.Declaration
Swift
public protocol CodingStrategyProvider
-
Options struct used for configuring the coding strategies on
See moreBSONEncoder
andBSONDecoder
.Declaration
Swift
public struct BSONCoderOptions : CodingStrategyProvider