19 lines
462 B
JavaScript
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,
|
|
}),
|
|
);
|