Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "core"

Index

Type aliases

Collection

Collection: Array<RawObject>

Represents an array of documents

CollectionResolver

CollectionResolver: (name: string) => Collection

Resolves the given string to a Collection. This is useful for operators that require a second collection to use such as $lookup and $out. The collection is not cached and will be resolved each time it is used.

Type declaration

OperatorMap

OperatorMap: Record<string, Callback<AnyVal>>

Map of operator functions

Functions

addOperators

  • Add new operators

    Parameters

    • cls: OperatorType

      the operator class to extend

    • operatorFn: Callback<OperatorMap>

      a callback that accepts internal object state and returns an object of new operators.

    Returns void

computeValue

  • Computes the value of the expression on the object for the given operator

    Parameters

    • obj: AnyVal

      the current object from the collection

    • expr: AnyVal

      the expression for the given field

    • operator: string

      the operator to resolve the field with

    • Optional options: ComputeOptions

      extra options

    Returns AnyVal

getOperator

  • Returns the operator function or null if it is not found

    Parameters

    • cls: OperatorType

      Category of the operator

    • operator: string

      Name of the operator

    Returns Callback<AnyVal> | null

makeOptions

  • Creates an Option from another required keys are initialized

    Parameters

    • Optional options: Options

      Options

    Returns Options

redact

useOperators

  • Register fully specified operators for the given operator class.

    Parameters

    Returns void

validateOperators

Object literals

Const OPERATORS

OPERATORS: object

[OperatorType.ACCUMULATOR]

[OperatorType.ACCUMULATOR]: {}

Type declaration

[OperatorType.EXPRESSION]

[OperatorType.EXPRESSION]: {}

Type declaration

[OperatorType.PIPELINE]

[OperatorType.PIPELINE]: {}

Type declaration

[OperatorType.PROJECTION]

[OperatorType.PROJECTION]: {}

Type declaration

[OperatorType.QUERY]

[OperatorType.QUERY]: {}

Type declaration

Const redactVariables

redactVariables: object

Implementation of $redact variables

Each function accepts 3 arguments (obj, expr, opt)

$$DESCEND

$$KEEP

$$PRUNE

Const systemVariables

systemVariables: object

Implementation of system variables

$$CURRENT

$$REMOVE

$$ROOT

Generated using TypeDoc