diff options
author | Scott Hernandez <scotthernandez@gmail.com> | 2014-02-12 15:28:15 -0500 |
---|---|---|
committer | Scott Hernandez <scotthernandez@gmail.com> | 2014-02-12 15:55:42 -0500 |
commit | ee77fd29885faa4ccbe2b019d3645e992267ee34 (patch) | |
tree | 0856bec4d0ef8778d7c20658d133690ec7e1a7ee /src/mongo/db/ops/update_driver.cpp | |
parent | 5e0365665f7244a9382b9bf078c890dce1cd5c03 (diff) | |
download | mongo-ee77fd29885faa4ccbe2b019d3645e992267ee34.tar.gz |
SERVER-12704: cleanup updatedriver options
Diffstat (limited to 'src/mongo/db/ops/update_driver.cpp')
-rw-r--r-- | src/mongo/db/ops/update_driver.cpp | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/src/mongo/db/ops/update_driver.cpp b/src/mongo/db/ops/update_driver.cpp index b3b0578dc42..1d3e3ef9222 100644 --- a/src/mongo/db/ops/update_driver.cpp +++ b/src/mongo/db/ops/update_driver.cpp @@ -49,8 +49,6 @@ namespace mongo { UpdateDriver::UpdateDriver(const Options& opts) : _replacementMode(false) , _indexedFields(NULL) - , _multi(opts.multi) - , _upsert(opts.upsert) , _logOp(opts.logOp) , _modOptions(opts.modOptions) , _affectIndices(false) @@ -61,12 +59,12 @@ namespace mongo { clear(); } - Status UpdateDriver::parse(const BSONObj& updateExpr) { + Status UpdateDriver::parse(const BSONObj& updateExpr, const bool multi) { clear(); // Check if the update expression is a full object replacement. if (*updateExpr.firstElementFieldName() != '$') { - if (_multi) { + if (multi) { return Status(ErrorCodes::FailedToParse, "multi update only works with $ operators"); } @@ -205,8 +203,6 @@ namespace mongo { // Create a new UpdateDriver to create the base doc from the query Options opts; opts.logOp = false; - opts.multi = false; - opts.upsert = true; opts.modOptions = modOptions(); UpdateDriver insertDriver(opts); @@ -396,22 +392,6 @@ namespace mongo { _indexedFields = indexedFields; } - bool UpdateDriver::multi() const { - return _multi; - } - - void UpdateDriver::setMulti(bool multi) { - _multi = multi; - } - - bool UpdateDriver::upsert() const { - return _upsert; - } - - void UpdateDriver::setUpsert(bool upsert) { - _upsert = upsert; - } - bool UpdateDriver::logOp() const { return _logOp; } |