1 | import "./init/basic";
|
2 | import { Aggregator } from "./aggregator";
|
3 | import { Options } from "./core";
|
4 | import { Cursor } from "./cursor";
|
5 | import { Source } from "./lazy";
|
6 | import { Query } from "./query";
|
7 | import { RawObject } from "./types";
|
8 | export { Aggregator } from "./aggregator";
|
9 | export { Query } from "./query";
|
10 | /**
|
11 | * Performs a query on a collection and returns a cursor object.
|
12 | * Shorthand for `Query(criteria).find(collection, projection)`
|
13 | *
|
14 | * @param collection Array of objects
|
15 | * @param criteria Query criteria
|
16 | * @param projection Projection criteria
|
17 | * @param options
|
18 | * @returns {Cursor} A cursor of results
|
19 | */
|
20 | export declare function find<T>(collection: Source, criteria: RawObject, projection?: RawObject, options?: Partial<Options>): Cursor<T>;
|
21 | /**
|
22 | * Returns a new array without objects which match the criteria
|
23 | *
|
24 | * @param collection Array of objects
|
25 | * @param criteria Query criteria of objects to remove
|
26 | * @param options
|
27 | * @returns {Array} New filtered array
|
28 | */
|
29 | export declare function remove(collection: RawObject[], criteria: RawObject, options?: Options): RawObject[];
|
30 | /**
|
31 | * Return the result collection after running the aggregation pipeline for the given collection.
|
32 | * Shorthand for `(new Aggregator(pipeline, options)).run(collection)`
|
33 | *
|
34 | * @param collection array or stream of objects
|
35 | * @param pipeline The pipeline operators to use
|
36 | * @param options
|
37 | * @returns {Array} New array of results
|
38 | */
|
39 | export declare function aggregate(collection: Source, pipeline: RawObject[], options?: Partial<Options>): RawObject[];
|
40 | declare const _default: {
|
41 | Aggregator: typeof Aggregator;
|
42 | Query: typeof Query;
|
43 | aggregate: typeof aggregate;
|
44 | find: typeof find;
|
45 | remove: typeof remove;
|
46 | };
|
47 | export default _default;
|