diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 4a327e60f2..9d57b231a3 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -8,6 +8,7 @@ // Ethan Resnick // vologa // jussikinnula +// 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; count(criteria: any, callback?: (err: any, count: number) => void): Query; + /** + * Counts number of matching documents in a database collection. + * @param criteria mongodb selector + */ + countDocuments(callback?: (err: any, count: number) => void): Query; + countDocuments(criteria: any, callback?: (err: any, count: number) => void): Query; + /** * Returns a wrapper around a mongodb driver cursor. A QueryCursor exposes a * Streams3-compatible interface, as well as a .next() function.