Skip to content

Commit

Permalink
fix(types): allow using path with $count
Browse files Browse the repository at this point in the history
Fix #12149
  • Loading branch information
vkarpov15 committed Aug 2, 2022
1 parent f50181e commit 7719569
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions test/types/expressions.test.ts
Expand Up @@ -217,3 +217,7 @@ const switchExpr: Expression.Switch = {
]
};
})();

(function gh12149() {
const count: Expression.Count = { $count: '$value' };
})();
2 changes: 1 addition & 1 deletion types/expressions.d.ts
Expand Up @@ -1977,7 +1977,7 @@ declare module 'mongoose' {
* @version 5.0
* @see https://docs.mongodb.com/manual/reference/operator/aggregation/count/#mongodb-expression-exp.-count
*/
$count: Record<string | number | symbol, never>;
$count: Record<string | number | symbol, never> | Path;
}

export interface CovariancePop {
Expand Down

0 comments on commit 7719569

Please sign in to comment.