Options
All
  • Public
  • Public/Protected
  • All
Menu

A class representation of the BSON Binary type.

see

http://mongodb.github.io/node-mongodb-native/2.1/api/Binary.html

Hierarchy

  • Binary

Index

Constructors

constructor

  • new Binary(buffer: Buffer, subType?: undefined | number): Binary
  • Parameters

    • buffer: Buffer

      A buffer object containing the binary data.

    • Optional subType: undefined | number

      The option binary type.

    Returns Binary

Properties

Static SUBTYPE_BYTE_ARRAY

SUBTYPE_BYTE_ARRAY: number

Byte Array BSON type.

Static SUBTYPE_DEFAULT

SUBTYPE_DEFAULT: number

Default BSON type.

Static SUBTYPE_FUNCTION

SUBTYPE_FUNCTION: number

Function BSON type.

Static SUBTYPE_MD5

SUBTYPE_MD5: number

MD5 BSON type.

Static SUBTYPE_USER_DEFINED

SUBTYPE_USER_DEFINED: number

User BSON type.

Static SUBTYPE_UUID

SUBTYPE_UUID: number

UUID BSON type.

Static SUBTYPE_UUID_OLD

SUBTYPE_UUID_OLD: number

OLD UUID BSON type

Methods

length

  • length(): number

put

  • put(byte_value: number | string): void
  • Updates this binary with byte_value.

    Parameters

    • byte_value: number | string

      A single byte we wish to write.

    Returns void

read

  • read(position: number, length: number): Buffer
  • Reads length bytes starting at position.

    Parameters

    • position: number

      Read from the given position in the Binary.

    • length: number

      The number of bytes to read.

    Returns Buffer

value

  • value(): string

write

  • write(buffer: Buffer | string, offset: number): void
  • Writes a buffer or string to the binary

    Parameters

    • buffer: Buffer | string

      A string or buffer to be written to the Binary BSON object.

    • offset: number

      Specify the binary of where to write the content.

    Returns void

Generated using TypeDoc