Skip to content

Commit 7469207

Browse files
committed
edits.
1 parent 8c118e6 commit 7469207

File tree

1 file changed

+4
-3
lines changed
  • django_mongodb_backend/fields

1 file changed

+4
-3
lines changed

django_mongodb_backend/fields/json.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,13 @@ def key_transform_is_null_expr(self, compiler, connection):
163163
164164
Reference: https://code.djangoproject.com/ticket/32252
165165
"""
166+
lhs_mql = process_lhs(self, compiler, connection)
167+
rhs_mql = process_rhs(self, compiler, connection)
168+
# Get the root column.
166169
previous = self.lhs
167170
while isinstance(previous, KeyTransform):
168171
previous = previous.lhs
169172
root_column = previous.as_mql(compiler, connection)
170-
lhs_mql = process_lhs(self, compiler, connection, as_path=False)
171-
rhs_mql = process_rhs(self, compiler, connection, as_path=False)
172173
return _has_key_predicate(lhs_mql, root_column, negated=rhs_mql)
173174

174175

@@ -186,8 +187,8 @@ def key_transform_numeric_lookup_mixin_expr(self, compiler, connection):
186187
Return MQL to check if the field exists (i.e., is not "missing" or "null")
187188
and that the field matches the given numeric lookup expression.
188189
"""
189-
lhs = process_lhs(self, compiler, connection, as_path=False)
190190
expr = builtin_lookup_expr(self, compiler, connection)
191+
lhs = process_lhs(self, compiler, connection)
191192
# Check if the type of lhs is not "missing" or "null".
192193
not_missing_or_null = {"$not": {"$in": [{"$type": lhs}, ["missing", "null"]]}}
193194
return {"$and": [expr, not_missing_or_null]}

0 commit comments

Comments
 (0)