jstests/aggregation/sources/setWindowFields/range.js
// Make a setWindowFields stage with the given bounds.
Make a setWindowFields stage with the given bounds.
Make a setWindowFields stage with the given bounds .
function range(lower, upper) {
    return {
        $setWindowFields: {
            partitionBy: "$partition",
            sortBy: {x: 1},
            output: {
                y: {$push: "$x", window: {range: [lower, upper]}},
            }
        }
    };
}
function range ( lower , upper ) { return { $setWindowFields : { partitionBy : "$partition" , sortBy : { x : 1 } , output : { y : { $push : "$x" , window : { range : [ lower , upper ] } } , } } } ; }
Make a setWindowFields stage with the given bounds.
Make a setWindowFields stage with the given bounds .