summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jstests/core/batch_write_command_update.js4
-rw-r--r--jstests/core/write_result.js4
-rw-r--r--src/mongo/db/commands/write_commands/batch_executor.h4
3 files changed, 6 insertions, 6 deletions
diff --git a/jstests/core/batch_write_command_update.js b/jstests/core/batch_write_command_update.js
index 7c9b052221e..ae5ec678910 100644
--- a/jstests/core/batch_write_command_update.js
+++ b/jstests/core/batch_write_command_update.js
@@ -260,7 +260,7 @@ printjson( request = {update : coll.getName(),
printjson( result = coll.runCommand(request) );
assert(result.ok);
assert.eq(2, result.n);
-assert.eq(undefined, result.nModified, "wrong nModified")
+assert.eq(0, result.nModified, "wrong nModified")
assert.eq(1, result.writeErrors.length);
assert.eq(2, result.writeErrors[0].index);
@@ -287,7 +287,7 @@ printjson( request = {update : coll.getName(),
printjson( result = coll.runCommand(request) );
assert(result.ok);
assert.eq(2, result.n);
-assert.eq(undefined, result.nModified, "wrong nModified");
+assert.eq(0, result.nModified, "wrong nModified");
assert.eq(2, result.writeErrors.length);
assert.eq(1, result.writeErrors[0].index);
diff --git a/jstests/core/write_result.js b/jstests/core/write_result.js
index c008c5ae404..1a2161873b2 100644
--- a/jstests/core/write_result.js
+++ b/jstests/core/write_result.js
@@ -111,7 +111,7 @@ printjson( result = coll.update({ foo : "bar" }, { $invalid : "expr" }) );
assert.eq(result.nUpserted, 0);
assert.eq(result.nMatched, 0);
if (coll.getMongo().writeMode() == "commands")
- assert.eq(undefined, result.nModified, result);
+ assert.eq(0, result.nModified, result);
assert(result.getWriteError());
assert(result.getWriteError().errmsg);
assert(!result.getUpsertedId());
@@ -131,7 +131,7 @@ printjson( result = coll.update({},
assert.eq(result.nUpserted, 0);
assert.eq(result.nMatched, 0);
if (coll.getMongo().writeMode() == "commands")
- assert.eq(undefined, result.nModified, result);
+ assert.eq(0, result.nModified, result);
assert(result.getWriteError());
assert(result.getWriteError().errmsg);
assert(!result.getUpsertedId());
diff --git a/src/mongo/db/commands/write_commands/batch_executor.h b/src/mongo/db/commands/write_commands/batch_executor.h
index 0f6fb25d293..4e5ce2e0aab 100644
--- a/src/mongo/db/commands/write_commands/batch_executor.h
+++ b/src/mongo/db/commands/write_commands/batch_executor.h
@@ -150,12 +150,12 @@ namespace mongo {
struct WriteOpStats {
WriteOpStats() :
- n( 0 ), nModified( -1 ) {
+ n( 0 ), nModified( 0 ) {
}
void reset() {
n = 0;
- nModified = -1;
+ nModified = 0;
upsertedID = BSONObj();
}