@@ -1150,6 +1150,21 @@ declare module 'mongoose' {
1150
1150
$first : Expression ;
1151
1151
}
1152
1152
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
+
1153
1168
export interface In {
1154
1169
/**
1155
1170
* Returns a boolean indicating whether a specified value is in an array.
@@ -1190,6 +1205,21 @@ declare module 'mongoose' {
1190
1205
$last : Expression ;
1191
1206
}
1192
1207
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
+
1193
1223
export interface LinearFill {
1194
1224
/**
1195
1225
* Fills null and missing fields in a window using linear interpolation based on surrounding field values.
@@ -2000,6 +2030,34 @@ declare module 'mongoose' {
2000
2030
$avg : Expression ;
2001
2031
}
2002
2032
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
+
2003
2061
export interface Count {
2004
2062
/**
2005
2063
* Returns the number of documents in a group.
@@ -2158,6 +2216,20 @@ declare module 'mongoose' {
2158
2216
$max : Expression | Expression [ ] ;
2159
2217
}
2160
2218
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
+
2161
2233
export interface Min {
2162
2234
/**
2163
2235
* Returns the minimum value. $min compares both value and type, using the specified BSON comparison order for
@@ -2169,6 +2241,20 @@ declare module 'mongoose' {
2169
2241
$min : Expression | Expression [ ] ;
2170
2242
}
2171
2243
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
+
2172
2258
export interface Push {
2173
2259
/**
2174
2260
* Returns an array of all values that result from applying an expression to documents.
@@ -2605,6 +2691,8 @@ declare module 'mongoose' {
2605
2691
export type ArrayExpressionOperatorReturningArray =
2606
2692
Expression . ConcatArrays |
2607
2693
Expression . Filter |
2694
+ Expression . FirstN |
2695
+ Expression . LastN |
2608
2696
Expression . Map |
2609
2697
Expression . ObjectToArray |
2610
2698
Expression . Range |
@@ -2763,12 +2851,16 @@ declare module 'mongoose' {
2763
2851
Expression . DocumentNumber |
2764
2852
Expression . ExpMovingAvg |
2765
2853
Expression . First |
2854
+ Expression . FirstN |
2766
2855
Expression . Integral |
2767
2856
Expression . Last |
2857
+ Expression . LastN |
2768
2858
Expression . LinearFill |
2769
2859
Expression . Locf |
2770
2860
Expression . Max |
2861
+ Expression . MaxN |
2771
2862
Expression . Min |
2863
+ Expression . MinN |
2772
2864
Expression . Push |
2773
2865
Expression . Rank |
2774
2866
Expression . Shift |
@@ -2783,6 +2875,10 @@ declare module 'mongoose' {
2783
2875
2784
2876
export type WindowOperatorReturningArray =
2785
2877
Expression . AddToSet |
2878
+ Expression . FirstN |
2879
+ Expression . LastN |
2880
+ Expression . MaxN |
2881
+ Expression . MinN |
2786
2882
Expression . Push ;
2787
2883
2788
2884
export type WindowOperatorReturningNumber =
@@ -2858,12 +2954,18 @@ declare module 'mongoose' {
2858
2954
Expression . Accumulator |
2859
2955
Expression . AddToSet |
2860
2956
Expression . Avg |
2957
+ Expression . Bottom |
2958
+ Expression . BottomN |
2861
2959
Expression . Count |
2862
2960
Expression . First |
2961
+ Expression . FirstN |
2863
2962
Expression . Last |
2963
+ Expression . LastN |
2864
2964
Expression . Max |
2965
+ Expression . MaxN |
2865
2966
Expression . MergeObjects |
2866
2967
Expression . Min |
2968
+ Expression . MinN |
2867
2969
Expression . Push |
2868
2970
Expression . StdDevPop |
2869
2971
Expression . StdDevSamp |
0 commit comments