diff options
author | David Storch <david.storch@10gen.com> | 2015-02-06 10:37:48 -0500 |
---|---|---|
committer | David Storch <david.storch@10gen.com> | 2015-02-09 16:48:21 -0500 |
commit | 570951951f752d1a31bb9e7f0d4276c1b533f25e (patch) | |
tree | bee30d476893c24992d6214b780796bc1e75a4a7 /src/mongo/db/ops/update_result.h | |
parent | e6e989f7fcf70d5bf5a5645b6927ac7a889dd5b7 (diff) | |
download | mongo-570951951f752d1a31bb9e7f0d4276c1b533f25e.tar.gz |
SERVER-17198 prevent invalid logOp rollback in findAndModify
Diffstat (limited to 'src/mongo/db/ops/update_result.h')
-rw-r--r-- | src/mongo/db/ops/update_result.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mongo/db/ops/update_result.h b/src/mongo/db/ops/update_result.h index 276813ae150..250b9d1fe23 100644 --- a/src/mongo/db/ops/update_result.h +++ b/src/mongo/db/ops/update_result.h @@ -43,7 +43,8 @@ namespace mongo { bool modifiers_, unsigned long long numDocsModified_, unsigned long long numMatched_, - const BSONObj& upsertedObject_ ); + const BSONObj& upsertedObject_, + const BSONObj& newObj_ ); // if existing objects were modified @@ -61,13 +62,18 @@ namespace mongo { // if something was upserted, the new _id of the object BSONObj upserted; + // For a non-multi update, the new version of the document. If we did an insert, this + // is the full document that got inserted (whereas 'upserted' is just the _id field). + BSONObj newObj; + const std::string toString() const { return str::stream() << " upserted: " << upserted << " modifiers: " << modifiers << " existing: " << existing << " numDocsModified: " << numDocsModified - << " numMatched: " << numMatched; + << " numMatched: " << numMatched + << " newObj: " << newObj; } }; |