From 0939e1447aa5b4291c09c1fab2344a66098213dd Mon Sep 17 00:00:00 2001 From: Nathan Myers Date: Mon, 25 Sep 2017 16:20:23 -0400 Subject: SERVER-29136 Plumb update document key through to op log --- src/mongo/db/update/update_driver.cpp | 19 ------------------- src/mongo/db/update/update_driver.h | 6 ------ 2 files changed, 25 deletions(-) (limited to 'src/mongo/db/update') diff --git a/src/mongo/db/update/update_driver.cpp b/src/mongo/db/update/update_driver.cpp index 3c6124e4d8e..cfcc2d891fd 100644 --- a/src/mongo/db/update/update_driver.cpp +++ b/src/mongo/db/update/update_driver.cpp @@ -558,25 +558,6 @@ void UpdateDriver::setCollator(const CollatorInterface* collator) { _modOptions.collator = collator; } -BSONObj UpdateDriver::makeOplogEntryQuery(const BSONObj& doc, bool multi) const { - BSONObjBuilder idPattern; - BSONElement id; - // NOTE: If the matching object lacks an id, we'll log - // with the original pattern. This isn't replay-safe. - // It might make sense to suppress the log instead - // if there's no id. - if (doc.getObjectID(id)) { - idPattern.append(id); - return idPattern.obj(); - } else { - uassert(16980, - str::stream() << "Multi-update operations require all documents to " - "have an '_id' field. " - << doc.toString(), - !multi); - return doc; - } -} void UpdateDriver::clear() { for (vector::iterator it = _mods.begin(); it != _mods.end(); ++it) { delete *it; diff --git a/src/mongo/db/update/update_driver.h b/src/mongo/db/update/update_driver.h index 823e8eafeeb..3a74b1ca753 100644 --- a/src/mongo/db/update/update_driver.h +++ b/src/mongo/db/update/update_driver.h @@ -97,12 +97,6 @@ public: const FieldRefSet& immutablePaths, mutablebson::Document& doc) const; - /** - * return a BSONObj with the _id field of the doc passed in, or the doc itself. - * If no _id and multi, error. - */ - BSONObj makeOplogEntryQuery(const BSONObj& doc, bool multi) const; - /** * Executes the update over 'doc'. If any modifier is positional, use 'matchedField' (index of * the array item matched). If 'doc' allows the modifiers to be applied in place and no index -- cgit v1.2.1