Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/hex/src/lib/data/deps.ts>mongo.Bson.serializeWithBufferAndIndex

An ecosystem delivering practices, philosophy and portability. Powered By Deno and JavaScript.
Latest
function mongo.Bson.serializeWithBufferAndIndex
import { mongo } from "https://deno.land/x/hex@0.6.5/src/lib/data/deps.ts";
const { serializeWithBufferAndIndex } = mongo.Bson;

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: Uint8Array
  • the Buffer you pre-allocated to store the serialized BSON object.
optional
options: SerializeOptions = [UNSUPPORTED]

Returns

number

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