@@ -1150,6 +1150,21 @@ declare module 'mongoose' {
11501150 $first : Expression ;
11511151 }
11521152
1153+ export interface FirstN {
1154+ /**
1155+ * $firstN can be used as an aggregation accumulator or array operator.
1156+ * As an aggregation accumulator, it returns an aggregation of the first n elements within a group.
1157+ * As an array operator, it returns the specified number of elements from the beginning of an array.
1158+ *
1159+ * @version 5.2
1160+ * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/firstN/#mongodb-expression-exp.-first
1161+ */
1162+ $firstN : {
1163+ input : Expression
1164+ n : Expression ,
1165+ } ;
1166+ }
1167+
11531168 export interface In {
11541169 /**
11551170 * Returns a boolean indicating whether a specified value is in an array.
@@ -1190,6 +1205,21 @@ declare module 'mongoose' {
11901205 $last : Expression ;
11911206 }
11921207
1208+ export interface LastN {
1209+ /**
1210+ * $lastN can be used as an aggregation accumulator or array operator.
1211+ * As an aggregation accumulator, it an aggregation of the last n elements within a group.
1212+ * As an array operator, it returns the specified number of elements from the end of an array.
1213+ *
1214+ * @version 5.2
1215+ * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/lastN/#mongodb-group-grp.-lastN
1216+ */
1217+ $lastN : {
1218+ input : Expression
1219+ n : Expression ,
1220+ } ;
1221+ }
1222+
11931223 export interface LinearFill {
11941224 /**
11951225 * Fills null and missing fields in a window using linear interpolation based on surrounding field values.
@@ -2000,6 +2030,34 @@ declare module 'mongoose' {
20002030 $avg : Expression ;
20012031 }
20022032
2033+ export interface Bottom {
2034+ /**
2035+ * Returns the bottom element within a group according to the specified sort order.
2036+ *
2037+ * @version 5.2
2038+ * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/bottom/#mongodb-group-grp.-bottom
2039+ */
2040+ $bottom : {
2041+ sortBy : AnyObject ,
2042+ output : Expression
2043+ } ;
2044+ }
2045+
2046+ export interface BottomN {
2047+ /**
2048+ * Returns an aggregation of the bottom n elements within a group, according to the specified sort order.
2049+ * If the group contains fewer than n elements, $bottomN returns all elements in the group.
2050+ *
2051+ * @version 5.2
2052+ * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/bottomN/#mongodb-group-grp.-bottomN
2053+ */
2054+ $bottomN : {
2055+ n : Expression ,
2056+ sortBy : AnyObject ,
2057+ output : Expression
2058+ } ;
2059+ }
2060+
20032061 export interface Count {
20042062 /**
20052063 * Returns the number of documents in a group.
@@ -2158,6 +2216,20 @@ declare module 'mongoose' {
21582216 $max : Expression | Expression [ ] ;
21592217 }
21602218
2219+ export interface MaxN {
2220+ /**
2221+ * Returns an aggregation of the maxmimum value n elements within a group.
2222+ * If the group contains fewer than n elements, $maxN returns all elements in the group.
2223+ *
2224+ * @version 5.2
2225+ * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/maxN/#mongodb-group-grp.-maxN
2226+ */
2227+ $maxN : {
2228+ input : Expression
2229+ n : Expression ,
2230+ } ;
2231+ }
2232+
21612233 export interface Min {
21622234 /**
21632235 * Returns the minimum value. $min compares both value and type, using the specified BSON comparison order for
@@ -2169,6 +2241,20 @@ declare module 'mongoose' {
21692241 $min : Expression | Expression [ ] ;
21702242 }
21712243
2244+ export interface MinN {
2245+ /**
2246+ * Returns an aggregation of the minimum value n elements within a group.
2247+ * If the group contains fewer than n elements, $minN returns all elements in the group.
2248+ *
2249+ * @version 5.2
2250+ * @see https://www.mongodb.com/docs/manual/reference/operator/aggregation/minN/#mongodb-group-grp.-minN
2251+ */
2252+ $minN : {
2253+ input : Expression
2254+ n : Expression ,
2255+ } ;
2256+ }
2257+
21722258 export interface Push {
21732259 /**
21742260 * Returns an array of all values that result from applying an expression to documents.
@@ -2605,6 +2691,8 @@ declare module 'mongoose' {
26052691 export type ArrayExpressionOperatorReturningArray =
26062692 Expression . ConcatArrays |
26072693 Expression . Filter |
2694+ Expression . FirstN |
2695+ Expression . LastN |
26082696 Expression . Map |
26092697 Expression . ObjectToArray |
26102698 Expression . Range |
@@ -2763,12 +2851,16 @@ declare module 'mongoose' {
27632851 Expression . DocumentNumber |
27642852 Expression . ExpMovingAvg |
27652853 Expression . First |
2854+ Expression . FirstN |
27662855 Expression . Integral |
27672856 Expression . Last |
2857+ Expression . LastN |
27682858 Expression . LinearFill |
27692859 Expression . Locf |
27702860 Expression . Max |
2861+ Expression . MaxN |
27712862 Expression . Min |
2863+ Expression . MinN |
27722864 Expression . Push |
27732865 Expression . Rank |
27742866 Expression . Shift |
@@ -2783,6 +2875,10 @@ declare module 'mongoose' {
27832875
27842876 export type WindowOperatorReturningArray =
27852877 Expression . AddToSet |
2878+ Expression . FirstN |
2879+ Expression . LastN |
2880+ Expression . MaxN |
2881+ Expression . MinN |
27862882 Expression . Push ;
27872883
27882884 export type WindowOperatorReturningNumber =
@@ -2858,12 +2954,18 @@ declare module 'mongoose' {
28582954 Expression . Accumulator |
28592955 Expression . AddToSet |
28602956 Expression . Avg |
2957+ Expression . Bottom |
2958+ Expression . BottomN |
28612959 Expression . Count |
28622960 Expression . First |
2961+ Expression . FirstN |
28632962 Expression . Last |
2963+ Expression . LastN |
28642964 Expression . Max |
2965+ Expression . MaxN |
28652966 Expression . MergeObjects |
28662967 Expression . Min |
2968+ Expression . MinN |
28672969 Expression . Push |
28682970 Expression . StdDevPop |
28692971 Expression . StdDevSamp |
0 commit comments