Skip to main content
Module

x/atlas_sdk/mod.ts>Bson.serializeWithBufferAndIndex

TypeSafe MongoDB Atlas Data API SDK for Deno & Deno Deploy
Go to Latest
function Bson.serializeWithBufferAndIndex
import { Bson } from "https://deno.land/x/atlas_sdk@v0.1.1/mod.ts";
const { serializeWithBufferAndIndex } = 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.