Module

x/atlas_sdk3/mod.ts>EJSON.parse

TypeSafe MongoDB Atlas Data API SDK for Deno & Deno Deploy
Latest
function EJSON.parse
import { EJSON } from "https://dotland.deno.dev/x/atlas_sdk3@v0.3.1/mod.ts";
const { parse } = EJSON;

Parse an Extended JSON string, constructing the JavaScript value or object described by that string.

Examples

Example 1

const { EJSON } = require('bson');
const text = '{ "int32": { "$numberInt": "10" } }';

// prints { int32: { [String: '10'] _bsontype: 'Int32', value: '10' } }
console.log(parse(text, { relaxed: false }));

// prints { int32: 10 }
console.log(parse(text));

Parameters

text: string
optional
options: Options