summaryrefslogtreecommitdiff
path: root/src/mongo/db/query
diff options
context:
space:
mode:
authorAnton Korshunov <anton.korshunov@mongodb.com>2020-08-10 07:02:39 +0100
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-08-13 08:17:45 +0000
commit4e337315d42e755eeb039a034fc660b8cbc1eaa9 (patch)
treeb57a8eba848e40e99c9e0090475f754288ee967b /src/mongo/db/query
parent38d86861e04ab6673292ebf05c126dabd1c5b822 (diff)
downloadmongo-4e337315d42e755eeb039a034fc660b8cbc1eaa9.tar.gz
SERVER-50151 Support $exists match expression in SBE
Diffstat (limited to 'src/mongo/db/query')
-rw-r--r--src/mongo/db/query/sbe_stage_builder_filter.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/mongo/db/query/sbe_stage_builder_filter.cpp b/src/mongo/db/query/sbe_stage_builder_filter.cpp
index 5fa173871af..ec303984939 100644
--- a/src/mongo/db/query/sbe_stage_builder_filter.cpp
+++ b/src/mongo/db/query/sbe_stage_builder_filter.cpp
@@ -554,9 +554,7 @@ public:
unsupportedExpression(expr);
}
void visit(const EqualityMatchExpression* expr) final {}
- void visit(const ExistsMatchExpression* expr) final {
- unsupportedExpression(expr);
- }
+ void visit(const ExistsMatchExpression* expr) final {}
void visit(const ExprMatchExpression* expr) final {
unsupportedExpression(expr);
}
@@ -706,7 +704,14 @@ public:
generateTraverseForComparisonPredicate(_context, expr, sbe::EPrimBinary::eq);
}
- void visit(const ExistsMatchExpression* expr) final {}
+ void visit(const ExistsMatchExpression* expr) final {
+ auto makeEExprFn = [](sbe::value::SlotId inputSlot) {
+ return sbe::makeE<sbe::EFunction>("exists",
+ sbe::makeEs(sbe::makeE<sbe::EVariable>(inputSlot)));
+ };
+ generateTraverse(_context, expr, std::move(makeEExprFn));
+ }
+
void visit(const ExprMatchExpression* expr) final {}
void visit(const GTEMatchExpression* expr) final {