summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/server_status_aggregation_stage_counter.js
diff options
context:
space:
mode:
authorMihai Andrei <mihai.andrei@10gen.com>2020-04-08 11:35:50 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-04-14 18:47:05 +0000
commit1740d32001cf77ce0dab6a1b1ec14d4b5be8bfef (patch)
tree35fdf1ca479f098a46e4a0f85a97216b485539ef /jstests/noPassthrough/server_status_aggregation_stage_counter.js
parent49d1262c366d439e6dd34b586c14ad64e8a764ab (diff)
downloadmongo-1740d32001cf77ce0dab6a1b1ec14d4b5be8bfef.tar.gz
SERVER-46937 Aggregation stage serverStatus counters incorrectly count update pipelines
Diffstat (limited to 'jstests/noPassthrough/server_status_aggregation_stage_counter.js')
-rw-r--r--jstests/noPassthrough/server_status_aggregation_stage_counter.js5
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"]);