Constant Name | Value | Description |
---|---|---|
BSON.BSON_DATA_NUMBER | 1 | Number BSON Type |
BSON.BSON_DATA_STRING | 2 | String BSON Type |
BSON.BSON_DATA_OBJECT | 3 | Object BSON Type |
BSON.BSON_DATA_ARRAY | 4 | Array BSON Type |
BSON.BSON_DATA_BINARY | 5 | Binary BSON Type |
BSON.BSON_DATA_OID | 7 | ObjectID BSON Type |
BSON.BSON_DATA_BOOLEAN | 8 | Boolean BSON Type |
BSON.BSON_DATA_DATE | 9 | Date BSON Type |
BSON.BSON_DATA_NULL | 10 | null BSON Type |
BSON.BSON_DATA_REGEXP | 11 | RegExp BSON Type |
BSON.BSON_DATA_CODE | 13 | Code BSON Type |
BSON.BSON_DATA_SYMBOL | 14 | Symbol BSON Type |
BSON.BSON_DATA_CODE_W_SCOPE | 15 | Code with Scope BSON Type |
BSON.BSON_DATA_INT | 16 | 32 bit Integer BSON Type |
BSON.BSON_DATA_TIMESTAMP | 17 | Timestamp BSON Type |
BSON.BSON_DATA_LONG | 18 | Long BSON Type |
BSON.BSON_DATA_MIN_KEY | 0xff | MinKey BSON Type |
BSON.BSON_DATA_MAX_KEY | 0x7f | MaxKey BSON Type |
BSON.BSON_BINARY_SUBTYPE_DEFAULT | 0 | Binary Default Type |
BSON.BSON_BINARY_SUBTYPE_FUNCTION | 1 | Binary Function Type |
BSON.BSON_BINARY_SUBTYPE_BYTE_ARRAY | 2 | Binary Byte Array Type |
BSON.BSON_BINARY_SUBTYPE_UUID | 3 | Binary UUID Type |
BSON.BSON_BINARY_SUBTYPE_MD5 | 4 | Binary MD5 Type |
BSON.BSON_BINARY_SUBTYPE_USER_DEFINED | 128 | Binary User Defined Type |
Calculate the bson size for a passed in Javascript object.
Arguments: |
|
---|---|
Returns: | number returns the number of bytes the BSON object will take up. |
Serialize a Javascript object using a predefined Buffer and index into the buffer, useful when pre-allocating the space for serialization.
Arguments: |
|
---|---|
Returns: | number returns the new write index in the Buffer. |
Serialize a Javascript object.
Arguments: |
|
---|---|
Returns: | buffer returns the Buffer object containing the serialized object. |
Deserialize stream data as BSON documents.
Arguments: |
|
---|---|
Returns: | number returns the next index in the buffer after deserialization x numbers of documents. |
Deserialize data as BSON.
Arguments: |
|
---|---|
Returns: | object returns the deserialized Javascript Object. |
Deserialize data as BSON.
Arguments: |
|
---|---|
Returns: | object returns the deserialized Javascript Object. |
Deserialize stream data as BSON documents.
Arguments: |
|
---|---|
Returns: | number returns the next index in the buffer after deserialization x numbers of documents. |
Serialize a Javascript object.
Arguments: |
|
---|---|
Returns: | buffer returns the Buffer object containing the serialized object. |
Calculate the bson size for a passed in Javascript object.
Arguments: |
|
---|---|
Returns: | number returns the number of bytes the BSON object will take up. |
Serialize a Javascript object using a predefined Buffer and index into the buffer, useful when pre-allocating the space for serialization.
Arguments: |
|
---|---|
Returns: | number returns the new write index in the Buffer. |