blob: 89dd16ac9a344b41ed88637daebffd0ac01a4ea4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
// Test that an aggregate command where the "pipeline" field has the wrong type fails with a
// TypeMismatch error.
(function() {
"use strict";
const coll = db.server25590;
coll.drop();
assert.commandWorked(coll.insert({}));
assert.commandFailedWithCode(db.runCommand({aggregate: coll.getName(), pipeline: 1}),
ErrorCodes.TypeMismatch);
assert.commandFailedWithCode(db.runCommand({aggregate: coll.getName(), pipeline: {}}),
ErrorCodes.TypeMismatch);
assert.commandFailedWithCode(db.runCommand({aggregate: coll.getName(), pipeline: [1, 2]}),
ErrorCodes.TypeMismatch);
assert.commandFailedWithCode(db.runCommand({aggregate: coll.getName(), pipeline: [1, null]}),
ErrorCodes.TypeMismatch);
})();
|