Skip to main content
Module

x/denodb/deps.ts>Bson.serializeWithBufferAndIndex

MySQL, SQLite, MariaDB, PostgreSQL and MongoDB ORM for Deno
Latest
function Bson.serializeWithBufferAndIndex
import { Bson } from "https://deno.land/x/denodb@v1.4.0/deps.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: 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.