Skip to main content
Extremely Popular
Go to Latest
function Bson.calculateObjectSize
import { Bson } from "https://deno.land/x/mongo@v0.31.0/mod.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