diff options
author | Mihai Andrei <mihai.andrei@10gen.com> | 2020-04-08 11:35:50 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-04-15 14:27:36 +0000 |
commit | 1067844167dec31e3a379ce0b63522e43e029c96 (patch) | |
tree | bf3e2d575ddad676eb56baf9bce0ca5a171a546d /jstests | |
parent | a4a4a102515557ad2ff39c07f1d1fb0b9f2d9778 (diff) | |
download | mongo-1067844167dec31e3a379ce0b63522e43e029c96.tar.gz |
SERVER-46937 Aggregation stage serverStatus counters incorrectly count update pipelines
(cherry picked from commit 1740d32001cf77ce0dab6a1b1ec14d4b5be8bfef)
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/noPassthrough/server_status_aggregation_stage_counter.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/jstests/noPassthrough/server_status_aggregation_stage_counter.js b/jstests/noPassthrough/server_status_aggregation_stage_counter.js index ead660a7cfd..c6d0fc50b41 100644 --- a/jstests/noPassthrough/server_status_aggregation_stage_counter.js +++ b/jstests/noPassthrough/server_status_aggregation_stage_counter.js @@ -48,7 +48,7 @@ function runTests(db, coll) { countersWeExpectToIncreaseMap = {}; // Setup for agg stages which have nested pipelines. - assert.commandWorked(db[coll].insert([ + assert.commandWorked(coll.insert([ {"_id": 1, "item": "almonds", "price": 12, "quantity": 2}, {"_id": 2, "item": "pecans", "price": 20, "quantity": 1}, {"_id": 3} @@ -100,7 +100,8 @@ function runTests(db, coll) { checkCounters(() => coll.explain().aggregate([{$match: {a: 5}}]), ["$match"]); // Verify that a pipeline in an update ticks counters. - checkCounters(() => coll.update({_id: 5}, [{$addFields: {a: {$add: ['$a', 1]}}}]), + checkCounters(() => coll.update( + {price: {$gte: 0}}, [{$addFields: {a: {$add: ['$a', 1]}}}], {multi: true}), ["$addFields"], ["$set"]); |