Function serializeWithBufferAndIndex

  • Serialize a Javascript object using a predefined Buffer and index into the buffer, useful when pre-allocating the space for serialization.

    Parameters

    • object: Document

      the Javascript object to serialize.

    • finalBuffer: Buffer

      the Buffer you pre-allocated to store the serialized BSON object.

    • Optional options: SerializeOptions

    Returns number

    the index pointing to the last written byte in the buffer.

Generated using TypeDoc