Skip to content

Commit 4135f34

Browse files
committed
Add docstring
1 parent 0033174 commit 4135f34

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

django_mongodb_backend/compiler.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,8 @@ def get_lookup_pipeline(self):
553553
where = self.get_where()
554554
promote_filters = defaultdict(list)
555555
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.
556558
if (
557559
isinstance(expr, Lookup)
558560
and isinstance(expr.lhs, Col)

django_mongodb_backend/query.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ def _get_reroot_replacements(expression):
197197
# "pushed down" into the join's $match stage to reduce the volume of
198198
# joined documents. This only applies to inner joins, as pushing
199199
# filters into a left join can change the semantics of the result.
200+
# LEFT JOINs may rely on null checks to detect missing RHS.
200201
if pushed_expression and self.join_type == INNER:
201202
rerooted_replacement = _get_reroot_replacements(pushed_expression)
202203
extra_conditions.append(

0 commit comments

Comments
 (0)