Skip to main content
The Deno 2 Release Candidate is here
Learn more
Latest
function Bson.calculateObjectSize
import { Bson } from "https://deno.land/x/model@v1.2/dependencies/mongo.ts";
const { calculateObjectSize } = Bson;

Calculate the bson size for a passed in Javascript object.

Parameters

object: Document
  • the Javascript object to calculate the BSON byte size for
optional
options: CalculateObjectSizeOptions = [UNSUPPORTED]

Returns

number

size of BSON object in bytes