summaryrefslogtreecommitdiff
path: root/jstests/noPassthroughWithMongod/mapreduce_intermediate_reduce.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/noPassthroughWithMongod/mapreduce_intermediate_reduce.js')
-rw-r--r--jstests/noPassthroughWithMongod/mapreduce_intermediate_reduce.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/jstests/noPassthroughWithMongod/mapreduce_intermediate_reduce.js b/jstests/noPassthroughWithMongod/mapreduce_intermediate_reduce.js
index fd7ec8c68e7..1ff024fcb03 100644
--- a/jstests/noPassthroughWithMongod/mapreduce_intermediate_reduce.js
+++ b/jstests/noPassthroughWithMongod/mapreduce_intermediate_reduce.js
@@ -15,14 +15,14 @@ var coll = db.getCollection("mrInput");
//
var expectedOutColl = [];
+var bulk = coll.initializeUnorderedBulkOp();
for (var i = 0; i < 10; i++) {
for (var j = 1; j < 50; j++) {
- coll.insert({idx: i, j: j});
+ bulk.insert({ idx: i, j: j });
}
expectedOutColl.push ({ _id: i, value: j - 1 });
}
-
-assertGLEOK(db.getLastErrorObj());
+assert.writeOK(bulk.execute());
function mapFn() { emit(this.idx, 1); };
function reduceFn(key, values) { return Array.sum(values); };
@@ -41,4 +41,4 @@ assert.eq(out.counts.emit, 490, "emit count is wrong");
// changed, such as reduceTriggerRatio or maxInMemSize. If not the case, then something else
// must have changed with when intermediate reduces occur (see mongo::mr::State::checkSize).
//
-assert.eq(out.counts.reduce, 14, "reduce count is wrong"); \ No newline at end of file
+assert.eq(out.counts.reduce, 14, "reduce count is wrong");