BSONNumber

public protocol BSONNumber : BSONValue

A protocol that numeric BSONValues should conform to. It provides functionality for converting to BSON’s native number types.

  • intValue Default implementation

    Create an Int from this BSONNumber. This will return nil if the conversion cannot result in an exact representation.

    Default Implementation

    Create an Int from this BinaryFloatingPoint. This will return nil if the conversion cannot result in an exact representation.

    Declaration

    Swift

    var intValue: Int? { get }
  • int32Value Default implementation

    Create an Int32 from this BSONNumber. This will return nil if the conversion cannot result in an exact representation.

    Default Implementation

    Create an Int32 from this BinaryFloatingPoint. This will return nil if the conversion cannot result in an exact representation.

    Declaration

    Swift

    var int32Value: Int32? { get }
  • int64Value Default implementation

    Create an Int64 from this BSONNumber. This will return nil if the conversion cannot result in an exact representation.

    Default Implementation

    Create an Int64 from this BinaryFloatingPoint. This will return nil if the conversion cannot result in an exact representation.

    Declaration

    Swift

    var int64Value: Int64? { get }
  • doubleValue Default implementation

    Create a Double from this BSONNumber. This will return nil if the conversion cannot result in an exact representation.

    Default Implementation

    Create a Double from this BinaryFloatingPoint. This will return nil if the conversion cannot result in an exact representation.

    Declaration

    Swift

    var doubleValue: Double? { get }
  • decimal128Value Default implementation

    Create a Decimal128 from this BSONNumber. This will return nil if the conversion cannot result in an exact representation.

    Default Implementation

    Create a Decimal128 from this Numeric. This will return nil if the conversion cannot result in an exact representation.

    Declaration

    Swift

    var decimal128Value: Decimal128? { get }