File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -313,3 +313,7 @@ const filterLimit: Expression.Filter = {
313
313
}
314
314
] ;
315
315
} ) ( ) ;
316
+
317
+ function gh15209 ( ) {
318
+ const query : PipelineStage [ ] = [ { $group : { _id : null , median : { $median : { input : '$value' , method : 'approximate' } } } } ] ;
319
+ }
Original file line number Diff line number Diff line change @@ -2301,6 +2301,18 @@ declare module 'mongoose' {
2301
2301
}
2302
2302
}
2303
2303
2304
+ export interface Median {
2305
+ /**
2306
+ * Returns an approximation of the median, the 50th percentile, as a scalar value.
2307
+ *
2308
+ * @see https://www.mongodb.com/docs/v7.0/reference/operator/aggregation/median/
2309
+ */
2310
+ $median : {
2311
+ input : number | Expression ,
2312
+ method : 'approximate'
2313
+ }
2314
+ }
2315
+
2304
2316
export interface StdDevPop {
2305
2317
/**
2306
2318
* Calculates the population standard deviation of the input values. Use if the values encompass the entire
@@ -2859,6 +2871,7 @@ declare module 'mongoose' {
2859
2871
Expression . Locf |
2860
2872
Expression . Max |
2861
2873
Expression . MaxN |
2874
+ Expression . Median |
2862
2875
Expression . Min |
2863
2876
Expression . MinN |
2864
2877
Expression . Push |
@@ -2891,6 +2904,7 @@ declare module 'mongoose' {
2891
2904
Expression . ExpMovingAvg |
2892
2905
Expression . Integral |
2893
2906
Expression . Max |
2907
+ Expression . Median |
2894
2908
Expression . Min |
2895
2909
Expression . StdDevPop |
2896
2910
Expression . StdDevSamp |
@@ -2963,6 +2977,7 @@ declare module 'mongoose' {
2963
2977
Expression . LastN |
2964
2978
Expression . Max |
2965
2979
Expression . MaxN |
2980
+ Expression . Median |
2966
2981
Expression . MergeObjects |
2967
2982
Expression . Min |
2968
2983
Expression . MinN |
You can’t perform that action at this time.
0 commit comments