diff options
author | Tess Avitabile <tess.avitabile@mongodb.com> | 2016-01-27 14:03:46 -0500 |
---|---|---|
committer | Tess Avitabile <tess.avitabile@mongodb.com> | 2016-01-29 17:37:34 -0500 |
commit | e40a6da919084cba4b0397c1da21c6ee93e78297 (patch) | |
tree | 3fcf06a181e1efd56338aa030ecc2227830cf527 /src/mongo/db/ops/update_result.cpp | |
parent | c532f7c7a970ad92949a0a2c48f36dae6dd3d5b4 (diff) | |
download | mongo-e40a6da919084cba4b0397c1da21c6ee93e78297.tar.gz |
SERVER-21823 Update and findAndModify with {upsert: true} should report nMatched:0 nModified:0 if results in an insert
Diffstat (limited to 'src/mongo/db/ops/update_result.cpp')
-rw-r--r-- | src/mongo/db/ops/update_result.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mongo/db/ops/update_result.cpp b/src/mongo/db/ops/update_result.cpp index 93f48fae668..a293ac98ba2 100644 --- a/src/mongo/db/ops/update_result.cpp +++ b/src/mongo/db/ops/update_result.cpp @@ -49,7 +49,7 @@ UpdateResult::UpdateResult(bool existing_, numDocsModified(numDocsModified_), numMatched(numMatched_) { BSONElement id = upsertedObject_["_id"]; - if (!existing && numMatched == 1 && !id.eoo()) { + if (!existing && numMatched == 0 && !id.eoo()) { upserted = id.wrap(kUpsertedFieldName); } LOG(4) << "UpdateResult -- " << toString(); |