diff options
Diffstat (limited to 'src/mongo/db/commands/write_commands/write_commands.cpp')
-rw-r--r-- | src/mongo/db/commands/write_commands/write_commands.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/db/commands/write_commands/write_commands.cpp b/src/mongo/db/commands/write_commands/write_commands.cpp index f6ded3a257f..8b53fe99b84 100644 --- a/src/mongo/db/commands/write_commands/write_commands.cpp +++ b/src/mongo/db/commands/write_commands/write_commands.cpp @@ -233,7 +233,7 @@ void serializeReply(OperationContext* opCtx, } } - long long n = 0; + long long nVal = 0; long long nModified = 0; std::vector<BSONObj> upsertInfo; std::vector<BSONObj> errors; @@ -255,7 +255,7 @@ void serializeReply(OperationContext* opCtx, for (size_t i = 0; i < result.results.size(); i++) { if (result.results[i].isOK()) { const auto& opResult = result.results[i].getValue(); - n += opResult.getN(); // Always there. + nVal += opResult.getN(); // Always there. if (replyStyle == ReplyStyle::kUpdate) { nModified += opResult.getNModified(); if (auto idElement = opResult.getUpsertedId().firstElement()) { @@ -325,7 +325,7 @@ void serializeReply(OperationContext* opCtx, errors.push_back(error.obj()); } - out->appendNumber("n", n); + out->appendNumber("n", nVal); if (replyStyle == ReplyStyle::kUpdate) { out->appendNumber("nModified", nModified); |