diff options
author | Andrew Morrow <acm@10gen.com> | 2013-12-30 14:14:14 -0500 |
---|---|---|
committer | Andrew Morrow <acm@10gen.com> | 2014-01-06 20:15:21 -0500 |
commit | 8b57f45b149b9df8ed2e9d7f74bf5d33a650cd5c (patch) | |
tree | b4af3480319251653cd10d8a56b3476a9fa661ae /src/mongo/db/ops/modifier_object_replace.cpp | |
parent | f4c05fbb804842a449e8131784069c2757ab2b23 (diff) | |
download | mongo-8b57f45b149b9df8ed2e9d7f74bf5d33a650cd5c.tar.gz |
SERVER-10159 Only do rematch for positional data when necessary
Diffstat (limited to 'src/mongo/db/ops/modifier_object_replace.cpp')
-rw-r--r-- | src/mongo/db/ops/modifier_object_replace.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mongo/db/ops/modifier_object_replace.cpp b/src/mongo/db/ops/modifier_object_replace.cpp index 4f48418a563..70b24a2cdf1 100644 --- a/src/mongo/db/ops/modifier_object_replace.cpp +++ b/src/mongo/db/ops/modifier_object_replace.cpp @@ -82,7 +82,8 @@ namespace mongo { ModifierObjectReplace::~ModifierObjectReplace() { } - Status ModifierObjectReplace::init(const BSONElement& modExpr, const Options& opts) { + Status ModifierObjectReplace::init(const BSONElement& modExpr, const Options& opts, + bool* positional) { if (modExpr.type() != Object) { // Impossible, really since the caller check this already... @@ -92,6 +93,10 @@ namespace mongo { << modExpr.type()); } + // Object replacements never have positional operator. + if (positional) + *positional = false; + // We make a copy of the object here because the update driver does not guarantees, in // the case of object replacement, that the modExpr is going to outlive this mod. _val = modExpr.embeddedObject().getOwned(); |