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(expressions): added missing Top operator to AccumulatorOperator type declaration #12952

Merged
merged 1 commit into from
Feb 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions test/types/expressions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ const timewithOffset430DateToString: Expression = { $dateToString: { format: '%H
const minutesOffsetNYDateToString: Expression = { $dateToString: { format: '%Z', date: '$date', timezone: 'America/New_York' } };
const minutesOffset430DateToString: Expression = { $dateToString: { format: '%Z', date: '$date', timezone: '+04:30' } };

const top: Expression.Top = {
$top: {
output: ['$playerId', '$score'],
sortBy: { score: 1 }
}
};

const topN: Expression.TopN = {
$topN: {
output: ['$playerId', '$score'],
Expand Down
1 change: 1 addition & 0 deletions types/expressions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2868,6 +2868,7 @@ declare module 'mongoose' {
Expression.StdDevPop |
Expression.StdDevSamp |
Expression.Sum |
Expression.Top |
Expression.TopN;

export type tzExpression = UTCOffset | StringExpressionOperatorReturningBoolean | string;
Expand Down