BSONValue

extension BSONValue

Convenience extension to get static bsonType from an instance

  • Default Decodable implementation that throws an error if executed with non-BSONDecoder.

    BSON types’ Deodable conformance currently only works with BSONDecoder, but in the future will be able to work with any decoder (e.g. JSONDecoder).

    Declaration

    Swift

    public init(from decoder: Decoder) throws
  • Default Encodable implementation that throws an error if executed with non-BSONEncoder.

    BSON types’ Encodable conformance currently only works with BSONEncoder, but in the future will be able to work with any encoder (e.g. JSONEncoder).

    Declaration

    Swift

    public func encode(to encoder: Encoder) throws