summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/expression.h
diff options
context:
space:
mode:
authorDavid Storch <david.storch@10gen.com>2017-04-12 14:53:25 -0400
committerDavid Storch <david.storch@10gen.com>2017-04-18 18:11:15 -0400
commitb9f9195390142f4e1363dc83b986ead5dc8993b8 (patch)
treed57f4c4643a64d3e64720a90560cc511dd8b5467 /src/mongo/db/pipeline/expression.h
parent071d0398b7e527fc5b8c1ffdd3474c91f34616f0 (diff)
downloadmongo-b9f9195390142f4e1363dc83b986ead5dc8993b8.tar.gz
SERVER-27115 extend $match swapping optimization to handle renamed fields
If a field renamed by $project or $addFields is used in a subsequent $match, we can now swap the $match and update it to use the original (or, "renamed from") field name. This allows $match planning to result in better index usage in some cases.
Diffstat (limited to 'src/mongo/db/pipeline/expression.h')
-rw-r--r--src/mongo/db/pipeline/expression.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mongo/db/pipeline/expression.h b/src/mongo/db/pipeline/expression.h
index a9eb4835a62..62bf6904fc5 100644
--- a/src/mongo/db/pipeline/expression.h
+++ b/src/mongo/db/pipeline/expression.h
@@ -769,6 +769,10 @@ public:
return _fieldPath;
}
+ Variables::Id getVariableId() const {
+ return _variable;
+ }
+
private:
ExpressionFieldPath(const boost::intrusive_ptr<ExpressionContext>& expCtx,
const std::string& fieldPath,