diff options
Diffstat (limited to 'jstests/aggregation/bugs')
-rw-r--r-- | jstests/aggregation/bugs/server7781.js | 7 | ||||
-rw-r--r-- | jstests/aggregation/bugs/server9444.js | 7 |
2 files changed, 6 insertions, 8 deletions
diff --git a/jstests/aggregation/bugs/server7781.js b/jstests/aggregation/bugs/server7781.js index e8684dd813f..678a224630a 100644 --- a/jstests/aggregation/bugs/server7781.js +++ b/jstests/aggregation/bugs/server7781.js @@ -11,10 +11,9 @@ db[coll].insert({loc: [0, 0]}); // $geoNear is only allowed as the first stage in a pipeline, nowhere else. - assertErrorCode( - db[coll], - [{$match: {x: 1}}, {$geoNear: {near: [1, 1], spherical: true, distanceField: 'dis'}}], - 28837); + assert.throws( + () => db[coll].aggregate( + [{$match: {x: 1}}, {$geoNear: {near: [1, 1], spherical: true, distanceField: 'dis'}}])); function checkOutput(cmdOut, aggOut, expectedNum) { assert.commandWorked(cmdOut, "geoNear command"); diff --git a/jstests/aggregation/bugs/server9444.js b/jstests/aggregation/bugs/server9444.js index f3dc2748b0a..b2f027d314c 100644 --- a/jstests/aggregation/bugs/server9444.js +++ b/jstests/aggregation/bugs/server9444.js @@ -29,17 +29,16 @@ assert.eq(res.code, outOfMemoryCode); // ensure allowDiskUse: false does what it says - var res = t.runCommand('aggregate', {pipeline: pipeline, allowDiskUse: false}); + res = t.runCommand('aggregate', {pipeline: pipeline, allowDiskUse: false}); assert.commandFailed(res); assert.eq(res.code, outOfMemoryCode); // allowDiskUse only supports bool. In particular, numbers aren't allowed. - var res = t.runCommand('aggregate', {pipeline: pipeline, allowDiskUse: 1}); + res = t.runCommand('aggregate', {pipeline: pipeline, allowDiskUse: 1}); assert.commandFailed(res); - assert.eq(res.code, 16949); // ensure we work when allowDiskUse === true - var res = t.aggregate(pipeline, {allowDiskUse: true}); + res = t.aggregate(pipeline, {allowDiskUse: true}); assert.eq(res.itcount(), t.count()); // all tests output one doc per input doc } |