enum classafBson::BsonType

sys::Obj
  sys::Enum
    afBson::BsonType

@Serializable { simple=true }

A list of BSON types.

@see http://bsonspec.org/spec.html

ARRAY

Source

const static BsonType ARRAY := ...

Maps to List. All vals must be valid BSON types.

BINARY

Source

const static BsonType BINARY := ...

Maps to Binary, or a Buf if the sub-type is BIN_GENERIC.

BOOLEAN

Source

const static BsonType BOOLEAN := ...

Maps to Bool.

CODE

Source

const static BsonType CODE := ...

Maps to Str (read only).

CODE_W_SCOPE

Source

const static BsonType CODE_W_SCOPE := ...

Code with scope.

(Deprecated, not used.)

DATE

Source

const static BsonType DATE := ...

Maps to DateTime.

DB_POINTER

Source

const static BsonType DB_POINTER := ...

DBPointer.

(Deprecated, not used.)

DECIMAL_128

Source

const static BsonType DECIMAL_128 := ...

128-bit decimal floating point number.

(Not supported.)

DOCUMENT

Source

const static BsonType DOCUMENT := ...

Maps to Map. All keys must be Str and all vals must be valid BSON types.

DOUBLE

Source

const static BsonType DOUBLE := ...

Maps to Float.

EOO

Source

const static BsonType EOO := ...

End-Of-Object. For internal use.

INTEGER_32

Source

const static BsonType INTEGER_32 := ...

Maps to Int (read only).

INTEGER_64

Source

const static BsonType INTEGER_64 := ...

Maps to Int.

MAX_KEY

Source

const static BsonType MAX_KEY := ...

Maps to MaxKey. For internal use.

MIN_KEY

Source

const static BsonType MIN_KEY := ...

Maps to MinKey. For internal use.

NULL

Source

const static BsonType NULL := ...

Maps to null.

OBJECT_ID

Source

const static BsonType OBJECT_ID := ...

Maps to ObjectId.

REGEX

Source

const static BsonType REGEX := ...

Maps to Regex.

STRING

Source

const static BsonType STRING := ...

Maps to Str.

SYMBOL

Source

const static BsonType SYMBOL := ...

Symbol.

(Deprecated, not used.)

TIMESTAMP

Source

const static BsonType TIMESTAMP := ...

Maps to Timestamp.

UNDEFINED

Source

const static BsonType UNDEFINED := ...

Undefined.

(Deprecated, not used.)

fromObj

Source

static new fromObj(Obj? obj, Bool checked := true)

Determines a BSON type from the type of the given object. Throws an ArgErr if invalid.

fromStr

Source

static new fromStr(Str name, Bool checked := true)

Return the BsonType instance for the specified name. If not a valid name and checked is false return null, otherwise throw ParseErr.

fromType

Source

static new fromType(Type? type, Bool checked := true)

Throws an ArgErr if invalid.

fromValue

Source

static new fromValue(Int value, Bool checked := true)

Throws an ArgErr if invalid.

isBsonLiteral

Source

const static Bool isBsonLiteral(Type? type)

Returns true if the given Type is a BSON literal. null and Buf are considered literals, whereas Maps and Lists are not.

BsonType.isBsonLiteral(Int#)      // --> true
BsonType.isBsonLiteral(Code#)     // --> true
BsonType.isBsonLiteral(null)      // --> true

BsonType.isBsonLiteral(List#)     // --> false
BsonType.isBsonLiteral(Str:Obj?#) // --> false
type

Source

const Type? type

The Fantom Type (if any) this BSON type maps to.

vals

Source

const static BsonType[] vals := ...

List of BsonType values indexed by ordinal

value

Source

const Int value

The value that uniquely identifies the type as per the BSON spec.