DataDecodingStrategy
public enum DataDecodingStrategy
Enum representing the various strategies for decoding Datas from BSON.
As per the BSON specification, the default strategy is to decode Datas from BSON binary types with the generic
binary subtype.
See also
bsonspec.org-
Decode
Datas by deferring to their default decoding implementation.Note: The default decoding implementation attempts to decode the
Datafrom a[UInt8], but because BSON does not support integer types otherInt32andInt64, it actually decodes from an[Int32]stored in BSON. This strategy paired with its corresponding encoding strategy results in an inefficient storage of theDatain BSON.Declaration
Swift
case deferredToData -
Decode
Datas stored as theBSONBinarytype (default).Declaration
Swift
case binary -
Decode
Datas stored as base64 encoded strings.Declaration
Swift
case base64 -
Decode
Datas using the provided closure.Declaration
Swift
case custom((_ decoder: Decoder) throws -> Data)
View on GitHub
Install in Dash
DataDecodingStrategy Enumeration Reference