27 lines
713 B
JavaScript
27 lines
713 B
JavaScript
/**
|
|
* Test that $push works as a window function.
|
|
*/
|
|
(function() {
|
|
"use strict";
|
|
|
|
load("jstests/aggregation/extras/window_function_helpers.js");
|
|
|
|
const featureEnabled =
|
|
assert.commandWorked(db.adminCommand({getParameter: 1, featureFlagWindowFunctions: 1}))
|
|
.featureFlagWindowFunctions.value;
|
|
if (!featureEnabled) {
|
|
jsTestLog("Skipping test because the window function feature flag is disabled");
|
|
return;
|
|
}
|
|
|
|
const coll = db[jsTestName()];
|
|
coll.drop();
|
|
|
|
// Create a collection of tickers and prices.
|
|
const nDocsPerTicker = 10;
|
|
seedWithTickerData(coll, nDocsPerTicker);
|
|
|
|
// Run the suite of partition and bounds tests against the $push function.
|
|
testAccumAgainstGroup(coll, "$push", []);
|
|
})();
|