Files
mongo/jstests/aggregation/sources/setWindowFields/exclude_from_api_version_1.js
Zac 591928c619 SERVER-108478 JS formatted by prettier and remove clang-format (#39656)
GitOrigin-RevId: 6c8f6aded47f260aa4f7c231b17dae3302cb1e04
2025-08-21 17:27:09 +00:00

19 lines
462 B
JavaScript

/**
* Test that $setWindowFields is excluded from API version 1.
*/
const coll = db[jsTestName()];
coll.drop();
coll.insert({a: 1});
coll.insert({a: 2});
// Test that $count is included from API Version 1 so long as it's used in $group.
assert.commandWorked(
db.runCommand({
aggregate: coll.getName(),
pipeline: [{$group: {_id: null, count: {$count: {}}}}],
cursor: {},
apiVersion: "1",
apiStrict: true,
}),
);