Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

types(aggregate): add $firstN, $lastN, $bottom, $bottomN, $minN and $maxN operators #15087

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

mlomnicki
Copy link
Contributor

Fixes #15086

Summary

Adds TypeScript support for the $firstN, $lastN, $bottom, $bottomN, $minN and $maxN operators

Examples

GameEntry.aggregate([
  {
     $sort: { score: -1 }
  },
  {
     $group: {
       _id: '$gameId',
      maxScores: {
        $firstN: { input: '$score', n: 3 }
     }  
  }
]);

@vkarpov15 vkarpov15 added this to the 8.9 milestone Dec 12, 2024
@vkarpov15 vkarpov15 merged commit 28c98d5 into Automattic:master Dec 12, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add missing types for $firstN, $lastN, $bottom, $bottomN, $minN and $maxN operators
2 participants