mongo-driver: Index | Files

package bsontype

import ""

Package bsontype is a utility package that contains types for each BSON type and the a stringifier for the Type to enable easier debugging when working with BSON.


Package Files


type Type Uses

type Type byte

Type represents a BSON type.

const (
    Double           Type = 0x01
    String           Type = 0x02
    EmbeddedDocument Type = 0x03
    Array            Type = 0x04
    Binary           Type = 0x05
    Undefined        Type = 0x06
    ObjectID         Type = 0x07
    Boolean          Type = 0x08
    DateTime         Type = 0x09
    Null             Type = 0x0A
    Regex            Type = 0x0B
    DBPointer        Type = 0x0C
    JavaScript       Type = 0x0D
    Symbol           Type = 0x0E
    CodeWithScope    Type = 0x0F
    Int32            Type = 0x10
    Timestamp        Type = 0x11
    Int64            Type = 0x12
    Decimal128       Type = 0x13
    MinKey           Type = 0xFF
    MaxKey           Type = 0x7F

These constants uniquely refer to each BSON type.

func (Type) String Uses

func (bt Type) String() string

String returns the string representation of the BSON type's name.

Package bsontype is imported by 25 packages. Updated 2019-09-15. Refresh now. Tools for package owners.