From 3042939e0f64bbb9076eef3ee1efcdd56fc02050 Mon Sep 17 00:00:00 2001 From: Scott Hernandez Date: Tue, 18 Feb 2014 13:54:49 -0500 Subject: SERVER-12625: skip oplog entries for no-op fields --- src/mongo/db/ops/modifier_object_replace.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/mongo/db/ops/modifier_object_replace.cpp') diff --git a/src/mongo/db/ops/modifier_object_replace.cpp b/src/mongo/db/ops/modifier_object_replace.cpp index ffdfa43112d..4748286b9d8 100644 --- a/src/mongo/db/ops/modifier_object_replace.cpp +++ b/src/mongo/db/ops/modifier_object_replace.cpp @@ -179,9 +179,13 @@ namespace mongo { Status status = logBuilder->getReplacementObject(&replacementObject); if (status.isOK()) { - BSONObjIterator it(_val); - while (status.isOK() && it.more()) - status = replacementObject.appendElement(it.next()); + mutablebson::Element current = _preparedState->doc.root().leftChild(); + while (current.ok()) { + status = replacementObject.appendElement(current.getValue()); + if (!status.isOK()) + return status; + current = current.rightSibling(); + } } return status; -- cgit v1.2.1