summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/index_partial_no_explain_cmds.js
diff options
context:
space:
mode:
authorJacob Evans <jacob.evans@mongodb.com>2019-12-11 21:33:49 +0000
committerevergreen <evergreen@mongodb.com>2019-12-11 21:33:49 +0000
commit57acc8b666b8c9dfc34eaf03c226ab26ac225781 (patch)
tree1a0971f0cce77fc5178fc48952770dc164818b22 /jstests/noPassthrough/index_partial_no_explain_cmds.js
parent3da6513067131a50323f3388b8dc2918da885732 (diff)
downloadmongo-57acc8b666b8c9dfc34eaf03c226ab26ac225781.tar.gz
SERVER-44475 Remove Query Knob
Diffstat (limited to 'jstests/noPassthrough/index_partial_no_explain_cmds.js')
-rw-r--r--jstests/noPassthrough/index_partial_no_explain_cmds.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/jstests/noPassthrough/index_partial_no_explain_cmds.js b/jstests/noPassthrough/index_partial_no_explain_cmds.js
index 9d0dc8eb246..2ad426d9d23 100644
--- a/jstests/noPassthrough/index_partial_no_explain_cmds.js
+++ b/jstests/noPassthrough/index_partial_no_explain_cmds.js
@@ -1,12 +1,15 @@
// Test partial indexes with commands that don't use explain. These commands are tested against
// mongod with the --notablescan flag set, so that they fail if the index is not used.
+load("jstests/aggregation/extras/utils.js"); // For resultsEq
(function() {
"use strict";
var runner = MongoRunner.runMongod({setParameter: "notablescan=1"});
-var coll = runner.getDB("test").index_partial_no_explain_cmds;
+const db = runner.getDB("test");
+var coll = db.index_partial_no_explain_cmds;
var ret;
coll.drop();
+db.getCollection("mrOutput").drop();
assert.commandWorked(coll.ensureIndex({x: 1}, {partialFilterExpression: {a: 1}}));
@@ -29,8 +32,9 @@ var reduceFunc = function(keyId, countArray) {
return Array.sum(countArray);
};
-ret = coll.mapReduce(mapFunc, reduceFunc, {out: "inline", query: {x: {$gt: 1}, a: 1}});
-assert.eq(1, ret.counts.input);
+assert.commandWorked(
+ coll.mapReduce(mapFunc, reduceFunc, {out: "mrOutput", query: {x: {$gt: 1}, a: 1}}));
+assert(resultsEq([{"_id": 2, "value": 1}], db.getCollection("mrOutput").find().toArray()));
//
// Test distinct.