mongoose: countDocuments() definitions added (#27283)

This commit is contained in:
ondratra 2018-07-21 03:20:55 +02:00 committed by Wesley Wigham
parent bfe8783484
commit 355dbd50e8

View File

@ -8,6 +8,7 @@
// Ethan Resnick <https://github.com/ethanresnick>
// vologa <https://github.com/vologab>
// jussikinnula <https://github.com/jussikinnula>
// ondratra <https://github.com/ondratra>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@ -1600,6 +1601,13 @@ declare module "mongoose" {
count(callback?: (err: any, count: number) => void): Query<number>;
count(criteria: any, callback?: (err: any, count: number) => void): Query<number>;
/**
* Counts number of matching documents in a database collection.
* @param criteria mongodb selector
*/
countDocuments(callback?: (err: any, count: number) => void): Query<number>;
countDocuments(criteria: any, callback?: (err: any, count: number) => void): Query<number>;
/**
* Returns a wrapper around a mongodb driver cursor. A Query<T>Cursor exposes a
* Streams3-compatible interface, as well as a .next() function.