diff options
author | Scott Hernandez <scotthernandez@gmail.com> | 2013-12-11 11:00:32 -0500 |
---|---|---|
committer | Scott Hernandez <scotthernandez@gmail.com> | 2013-12-13 15:51:49 -0500 |
commit | 34738d8f39dae85b10687b207473e61b52b5b93c (patch) | |
tree | ef13e89af32eb2696824b19b7b7ca8d23ad9eb76 /src/mongo/db/ops/modifier_unset.cpp | |
parent | 2c54682ce88e2c4e7fe8c99baeadfece0831dbd2 (diff) | |
download | mongo-34738d8f39dae85b10687b207473e61b52b5b93c.tar.gz |
SERVER-12029: use $unset true in logbuilder, and unset mod
Diffstat (limited to 'src/mongo/db/ops/modifier_unset.cpp')
-rw-r--r-- | src/mongo/db/ops/modifier_unset.cpp | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/src/mongo/db/ops/modifier_unset.cpp b/src/mongo/db/ops/modifier_unset.cpp index 2e55fe0b5e8..7a59c0ba261 100644 --- a/src/mongo/db/ops/modifier_unset.cpp +++ b/src/mongo/db/ops/modifier_unset.cpp @@ -179,21 +179,7 @@ namespace mongo { } Status ModifierUnset::log(LogBuilder* logBuilder) const { - - // We'd like to create an entry such as {$unset: {<fieldname>: 1}} under 'logRoot'. - // We start by creating the {$unset: ...} Element. - mutablebson::Document& doc = logBuilder->getDocument(); - - // Create the {<fieldname>: <value>} Element. Note that <fieldname> must be a - // dotted field, and not only the last part of that field. The rationale here is that - // somoene picking up this log entry -- e.g., a secondary -- must be capable of doing - // the same path find/creation that was done in the previous calls here. - mutablebson::Element logElement = doc.makeElementInt(_fieldRef.dottedField(), 1); - if (!logElement.ok()) { - return Status(ErrorCodes::InternalError, "cannot create log details for $unset mod"); - } - - return logBuilder->addToUnsets(logElement); + return logBuilder->addToUnsets(_fieldRef.dottedField()); } } // namespace mongo |