File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,8 @@ const topN: Expression.TopN = {
8686 }
8787} ;
8888
89+ const d : Expression . Avg = { $avg : { $subtract : [ { $ifNull : [ '$end' , new Date ( ) ] } , '$start' ] } } ;
90+
8991const dateSubtract1 : Expression = {
9092 $dateSubtract :
9193 {
@@ -167,6 +169,13 @@ const letExpr: Expression = {
167169 }
168170} ;
169171
172+ const addWithNull : Expression . Add = {
173+ $add : [
174+ '$price' ,
175+ { $ifNull : [ '$tax' , 0 ] }
176+ ]
177+ }
178+
170179const toLong : Expression = { $toLong : '$qty' } ;
171180
172181const nullExpr : Expression = {
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ declare module 'mongoose' {
3232 *
3333 * @see https://docs.mongodb.com/manual/reference/operator/aggregation/add/#mongodb-expression-exp.-add
3434 */
35- $add : ( NumberExpression | DateExpression ) [ ] ;
35+ $add : Expression [ ] ;
3636 }
3737
3838 export interface Ceil {
@@ -1967,7 +1967,7 @@ declare module 'mongoose' {
19671967 * @version 5.0
19681968 * @see https://docs.mongodb.com/manual/reference/operator/aggregation/avg/#mongodb-expression-exp.-avg
19691969 */
1970- $avg : ArrayExpression ;
1970+ $avg : Expression ;
19711971 }
19721972
19731973 export interface Count {
You can’t perform that action at this time.
0 commit comments