diff options
Diffstat (limited to 'src/mongo/db/matcher/expression_leaf.h')
-rw-r--r-- | src/mongo/db/matcher/expression_leaf.h | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/mongo/db/matcher/expression_leaf.h b/src/mongo/db/matcher/expression_leaf.h index 77123742849..643ad22ab3b 100644 --- a/src/mongo/db/matcher/expression_leaf.h +++ b/src/mongo/db/matcher/expression_leaf.h @@ -47,12 +47,19 @@ class CollatorInterface; class LeafMatchExpression : public PathMatchExpression { public: - explicit LeafMatchExpression(MatchType matchType, StringData path) - : PathMatchExpression(matchType, path) { - setTraverseLeafArray(); - } + LeafMatchExpression(MatchType matchType, StringData path) + : LeafMatchExpression(matchType, + path, + ElementPath::LeafArrayBehavior::kTraverse, + ElementPath::NonLeafArrayBehavior::kTraverse) {} + + LeafMatchExpression(MatchType matchType, + StringData path, + ElementPath::LeafArrayBehavior leafArrBehavior, + ElementPath::NonLeafArrayBehavior nonLeafArrBehavior) + : PathMatchExpression(matchType, path, leafArrBehavior, nonLeafArrBehavior) {} - virtual ~LeafMatchExpression() {} + virtual ~LeafMatchExpression() = default; size_t numChildren() const override { return 0; @@ -66,10 +73,6 @@ public: return nullptr; } - bool shouldExpandLeafArray() const override { - return true; - } - MatchCategory getCategory() const override { return MatchCategory::kLeaf; } |