BSONType

public enum BSONType : UInt32

The possible types of BSON values and their corresponding integer values.

  • An invalid type

    Declaration

    Swift

    case invalid = 0x00
  • 64-bit binary floating point

    Declaration

    Swift

    case double = 0x01
  • UTF-8 string

    Declaration

    Swift

    case string = 0x02
  • BSON document

    Declaration

    Swift

    case document = 0x03
  • Array

    Declaration

    Swift

    case array = 0x04
  • Binary data

    Declaration

    Swift

    case binary = 0x05
  • Undefined value - deprecated

    Declaration

    Swift

    case undefined = 0x06
  • Declaration

    Swift

    case objectId = 0x07
  • A boolean

    Declaration

    Swift

    case boolean = 0x08
  • UTC datetime, stored as UTC milliseconds since the Unix epoch

    Declaration

    Swift

    case dateTime = 0x09
  • Null value

    Declaration

    Swift

    case null = 0x0a
  • A regular expression

    Declaration

    Swift

    case regularExpression = 0x0b
  • A database pointer - deprecated

    Declaration

    Swift

    case dbPointer = 0x0c
  • Javascript code

    Declaration

    Swift

    case javascript = 0x0d
  • A symbol - deprecated

    Declaration

    Swift

    case symbol = 0x0e
  • JavaScript code w/ scope

    Declaration

    Swift

    case javascriptWithScope = 0x0f
  • 32-bit integer

    Declaration

    Swift

    case int32 = 0x10
  • Special internal type used by MongoDB replication and sharding

    Declaration

    Swift

    case timestamp = 0x11
  • 64-bit integer

    Declaration

    Swift

    case int64 = 0x12
  • 128-bit decimal floating point

    Declaration

    Swift

    case decimal128 = 0x13
  • Special type which compares lower than all other possible BSON element values

    Declaration

    Swift

    case minKey = 0xff
  • Special type which compares higher than all other possible BSON element values

    Declaration

    Swift

    case maxKey = 0x7f