summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage/duplicate_key_error_info.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/storage/duplicate_key_error_info.h')
-rw-r--r--src/mongo/db/storage/duplicate_key_error_info.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/mongo/db/storage/duplicate_key_error_info.h b/src/mongo/db/storage/duplicate_key_error_info.h
index 06a17cce94c..d913412f5d9 100644
--- a/src/mongo/db/storage/duplicate_key_error_info.h
+++ b/src/mongo/db/storage/duplicate_key_error_info.h
@@ -45,8 +45,8 @@ public:
static std::shared_ptr<const ErrorExtraInfo> parse(const BSONObj&);
- explicit DuplicateKeyErrorInfo(const BSONObj& keyPattern)
- : _keyPattern(keyPattern.getOwned()) {}
+ explicit DuplicateKeyErrorInfo(const BSONObj& keyPattern, const BSONObj& keyValue)
+ : _keyPattern(keyPattern.getOwned()), _keyValue(keyValue.getOwned()) {}
void serialize(BSONObjBuilder* bob) const override;
@@ -60,8 +60,13 @@ public:
return _keyPattern;
}
+ const BSONObj& getDuplicatedKeyValue() const {
+ return _keyValue;
+ }
+
private:
- const BSONObj _keyPattern;
+ BSONObj _keyPattern;
+ BSONObj _keyValue;
};
} // namespace mongo