Binary()

Constructor

A class representation of the BSON Binary type.

class Binary()
Arguments:
  • buffer (buffer) – a buffer object containing the binary data.
  • [subType] (number) – the option binary type.
Returns:

binary

Sub types
  • BSON.BSON_BINARY_SUBTYPE_DEFAULT, default BSON type.
  • BSON.BSON_BINARY_SUBTYPE_FUNCTION, BSON function type.
  • BSON.BSON_BINARY_SUBTYPE_BYTE_ARRAY, BSON byte array type.
  • BSON.BSON_BINARY_SUBTYPE_UUID, BSON uuid type.
  • BSON.BSON_BINARY_SUBTYPE_MD5, BSON md5 type.
  • BSON.BSON_BINARY_SUBTYPE_USER_DEFINED, BSON user defined type.

Constants

Constant Name Value Description
Binary.SUBTYPE_DEFAULT 0 Default BSON type
Binary.SUBTYPE_FUNCTION 1 Function BSON type
Binary.SUBTYPE_BYTE_ARRAY 2 Byte Array BSON type
Binary.SUBTYPE_UUID_OLD 3 OLD UUID BSON type
Binary.SUBTYPE_UUID 4 UUID BSON type
Binary.SUBTYPE_MD5 5 MD5 BSON type
Binary.SUBTYPE_USER_DEFINED 128 User BSON type

Contents

Manual

MongoDB Wiki