mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-31 19:12:20 +08:00
Expose Aggregate.count(countName) method
The Aggregate class should expose a `count(countName)` method that adds a `$count` aggregator in the pipeline. Documented here: http://mongoosejs.com/docs/api.html#aggregate_Aggregate-count Code @5.0.15 referencing this method: https://github.com/Automattic/mongoose/blob/5.0.15/lib/aggregate.js#L379
This commit is contained in:
6
types/mongoose/index.d.ts
vendored
6
types/mongoose/index.d.ts
vendored
@@ -2274,6 +2274,12 @@ declare module "mongoose" {
|
||||
/** Adds a collation. */
|
||||
collation(options: CollationOptions): this;
|
||||
|
||||
/**
|
||||
* Appends a new $count operator to this aggregate pipeline.
|
||||
* @param countName name of the count field
|
||||
*/
|
||||
count(countName: string): this;
|
||||
|
||||
/**
|
||||
* Sets the cursor option option for the aggregation query (ignored for < 2.6.0).
|
||||
* Note the different syntax below: .exec() returns a cursor object, and no callback
|
||||
|
||||
Reference in New Issue
Block a user