mirror of
https://github.com/FerretDB/documentdb.git
synced 2026-11-26 04:09:50 -05:00
### Does this PR have any customer impact? Yes ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) Yes ### Are you introducing any new config? If yes, do you have tests with and without them being set? No ### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md)) ### Description $top, $topN, $bottom, $bottomN implementation for $group and $setWindowFields ---- #### AI description (iteration 1) #### PR Classification New feature: Added support for `$topN` and `$bottomN` group expression operators. #### PR Summary This pull request introduces the `$topN` and `$bottomN` group expression operators to the aggregation pipeline. - `bson_aggregation_pipeline.c`: Added `ParseInputDocumentForTopAndBottom` function to parse input documents for `$topN` and `$bottomN` operators, and integrated it into the existing aggregation handling logic. - `mongo_errors.h`: Defined new error codes for handling errors related to the new operators. Related work items: #2151574, #2151576, #2151596, #2151597, #2988406, #2988407, #2988413, #2988415