Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace MongoBson

Index

Functions

Functions

fromObject

  • fromObject(mix: any, Type?: any): any
  • Traverse the object and convert any unsupported type to a mongodb capable type. It also use class-json to serialize an object. For example, bigint to

    • Decimal128 in case '> MAX_SAFE_INTEGER'
    • number in case '< MAX_SAFE_INTEGER'
    • string any other case

    Parameters

    • mix: any

      Object to walk through

    • Optional Type: any

      Optionaly the Type Declaration, it could contain Meta data for json serialization.

    Returns any

toObject

  • toObject<T>(bson: any, Type?: new (...args: any) => T): T
  • Type parameters

    • T = any

    Parameters

    • bson: any
    • Optional Type: new (...args: any) => T
        • new (...args: any): T
        • Parameters

          • Rest ...args: any

          Returns T

    Returns T

Generated using TypeDoc