Skip to content

Commit f783c8e

Browse files
committed
handle the case of None being passed
1 parent 77f9d34 commit f783c8e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

django_mongodb_backend/query_conversion/expression_converters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def convert(cls, args):
7777
# Check if first argument is a simple field reference.
7878
if (field_name := cls.convert_path_name(field_expr)) and cls.is_simple_value(value):
7979
if cls.operator == "$eq":
80-
return {field_name: value}
80+
return {field_name: {"$exists": False} if value is None else value}
8181
return {field_name: {cls.operator: value}}
8282
return None
8383

0 commit comments

Comments
 (0)