Files
mongo/jstests/aggregation/sources/setWindowFields/exclude_from_api_version_1.js
2023-08-06 20:48:04 +00:00

16 lines
429 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
}));