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 = {
313313 }
314314 ] ;
315315} ) ( ) ;
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' {
23012301 }
23022302 }
23032303
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+
23042316 export interface StdDevPop {
23052317 /**
23062318 * Calculates the population standard deviation of the input values. Use if the values encompass the entire
@@ -2859,6 +2871,7 @@ declare module 'mongoose' {
28592871 Expression . Locf |
28602872 Expression . Max |
28612873 Expression . MaxN |
2874+ Expression . Median |
28622875 Expression . Min |
28632876 Expression . MinN |
28642877 Expression . Push |
@@ -2891,6 +2904,7 @@ declare module 'mongoose' {
28912904 Expression . ExpMovingAvg |
28922905 Expression . Integral |
28932906 Expression . Max |
2907+ Expression . Median |
28942908 Expression . Min |
28952909 Expression . StdDevPop |
28962910 Expression . StdDevSamp |
@@ -2963,6 +2977,7 @@ declare module 'mongoose' {
29632977 Expression . LastN |
29642978 Expression . Max |
29652979 Expression . MaxN |
2980+ Expression . Median |
29662981 Expression . MergeObjects |
29672982 Expression . Min |
29682983 Expression . MinN |
You can’t perform that action at this time.
0 commit comments