Skip to content

Commit c7de5fb

Browse files
committed
Add contains partial index expression.
1 parent a78036f commit c7de5fb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

django_mongodb/base.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ def _isnull_operator(a, b):
131131
# Operators like $exists: False, $ne, and $nor cannot be used in partial indexes.
132132
# So, indexes on null values (isnull=True|False) can't be implemented.
133133
"isnull": lambda a, b: {}, # noqa: ARG005
134+
# Partial indexes do not support the $regex expression.
135+
"contains": lambda a, b: {}, # noqa: ARG005
134136
}
135137

136138
display_name = "MongoDB"

0 commit comments

Comments
 (0)