Variable default

default: {
    aggregate: ((collection: Source, pipeline: AnyObject[], options?: Partial<Options>) => AnyObject[]);
    Aggregator: typeof Aggregator;
    find: (<T>(collection: Source, criteria: AnyObject, projection?: AnyObject, options?: Partial<Options>) => Cursor<T>);
    Query: typeof Query;
    remove: ((collection: AnyObject[], criteria: AnyObject, options?: Options) => AnyObject[]);
}

Type declaration

  • aggregate: ((collection: Source, pipeline: AnyObject[], options?: Partial<Options>) => AnyObject[])
      • (collection, pipeline, options?): AnyObject[]
      • Return the result collection after running the aggregation pipeline for the given collection. Shorthand for (new Aggregator(pipeline, options)).run(collection)

        Parameters

        • collection: Source

          array or stream of objects

        • pipeline: AnyObject[]

          The pipeline operators to use

        • Optionaloptions: Partial<Options>

        Returns AnyObject[]

        New array of results

  • Aggregator: typeof Aggregator
  • find: (<T>(collection: Source, criteria: AnyObject, projection?: AnyObject, options?: Partial<Options>) => Cursor<T>)
      • <T>(collection, criteria, projection?, options?): Cursor<T>
      • Performs a query on a collection and returns a cursor object. Shorthand for Query(criteria).find(collection, projection)

        Type Parameters

        • T

        Parameters

        Returns Cursor<T>

        A cursor of results

  • Query: typeof Query
  • remove: ((collection: AnyObject[], criteria: AnyObject, options?: Options) => AnyObject[])
      • (collection, criteria, options?): AnyObject[]
      • Returns a new array without objects which match the criteria

        Parameters

        Returns AnyObject[]

        New filtered array