mingo
Version:
MongoDB query language for in-memory objects
13 lines (12 loc) • 451 B
TypeScript
import { Any, AnyObject, Options, SortSpec } from "../../types";
interface InputExpr {
n: number;
sortBy: SortSpec;
output: Any;
}
/**
* Returns an aggregation of the top n elements within a group, according to the specified sort order.
* If the group contains fewer than n elements, $topN returns all elements in the group.
*/
export declare const $topN: (coll: AnyObject[], expr: InputExpr, options: Options) => unknown[];
export {};