File tree Expand file tree Collapse file tree 2 files changed +3
-0
lines changed Expand file tree Collapse file tree 2 files changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -553,6 +553,8 @@ def get_lookup_pipeline(self):
553
553
where = self .get_where ()
554
554
promote_filters = defaultdict (list )
555
555
for expr in where .children if where and where .connector == AND else ():
556
+ # Push only basic lookups (no subqueries or complex conditions).
557
+ # We push by LHS alias to avoid duplication across subqueries.
556
558
if (
557
559
isinstance (expr , Lookup )
558
560
and isinstance (expr .lhs , Col )
Original file line number Diff line number Diff line change @@ -197,6 +197,7 @@ def _get_reroot_replacements(expression):
197
197
# "pushed down" into the join's $match stage to reduce the volume of
198
198
# joined documents. This only applies to inner joins, as pushing
199
199
# filters into a left join can change the semantics of the result.
200
+ # LEFT JOINs may rely on null checks to detect missing RHS.
200
201
if pushed_expression and self .join_type == INNER :
201
202
rerooted_replacement = _get_reroot_replacements (pushed_expression )
202
203
extra_conditions .append (
You can’t perform that action at this time.
0 commit comments