summaryrefslogtreecommitdiff
path: root/jstests/noPassthroughWithMongod/mapreduce_intermediate_reduce.js
diff options
context:
space:
mode:
authorRandolph Tan <randolph@10gen.com>2014-05-14 14:11:11 -0400
committerRandolph Tan <randolph@10gen.com>2014-05-15 14:04:11 -0400
commit0dabee8227d445a18fa5e8e49b2be60ba2a0beef (patch)
tree5cd9058a4483202c2f7e2ab6f5c44079a74ac157 /jstests/noPassthroughWithMongod/mapreduce_intermediate_reduce.js
parent4de88387eec6c0bb08b10d0ba1574a656f56232d (diff)
downloadmongo-0dabee8227d445a18fa5e8e49b2be60ba2a0beef.tar.gz
SERVER-13741 Migrate remaining tests to use write commands
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");