Created
September 22, 2022 20:06
-
-
Save jyemin/09433eaa638d532f17e64a0b5f399318 to your computer and use it in GitHub Desktop.
An "annotated" aggregation expression showing intermediate values at everly level of the expression tree
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$reduce": { // 300 | |
"input": { // [2, 4, 6, 8, 10] | |
"$map": { // [2, 4, 6, 8, 10] | |
"input": { // [2, 4, 6, 8, 10] | |
"$filter": { // [2, 4, 6, 8, 10] | |
"input": "$numList", // [1, 2, 3, 4, 5, 6, 7, 8, 9. 10] | |
"cond": { | |
"$eq": [ // [false, true, false, true, false, true, false, true, false, true] | |
{ | |
"$mod": [ // [1, 0, 1, 0, 1, 0, 1, 0, 1, 0] | |
"$$this", | |
2 // 2 | |
] | |
}, | |
0 // 0 | |
] | |
} | |
} | |
}, | |
"in": { // [20, 40, 60, 80, 100] | |
"$multiply": [ // [20, 40, 60, 80, 100] | |
"$$this", | |
10 | |
] | |
} | |
} | |
}, | |
"initialValue": 0, // 0 | |
"in": { // 300 | |
"$add": [ // [0, 20, 60, 120, 200, 300] | |
"$$value", | |
"$$this" | |
] | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment