Add missing types for $firstN, $lastN, $bottom, $bottomN, $minN and $maxN operators #15299
Open
2 tasks done
Labels
typescript
Types or Types-test related issue / Pull Request
Prerequisites
Mongoose version
6.13.8
Node.js version
22.12.0
MongoDB server version
6.0.17
Typescript version (if applicable)
5.7.2
Description
MongoDB 5.2 introduced several new accumulation operators, including $top, $topN, $firstN, $lastN, $minN and $maxN. While $top and $topN work as expected, the other operators currently cause TypeScript errors when used with Mongoose.
Steps to Reproduce
Query:
Error:
Object literal may only specify known properties, and $firstN does not exist in type AccumulatorOperator
Expected Behavior
Expected $firstN, $lastN, $minN, $maxN, $bottom and $bottomN to be supported as aggregation operators on v6(v7 might be needed too).
The text was updated successfully, but these errors were encountered: