Skip to content

Commit 6c6fc6a

Browse files
committed
Add contains partial index expression.
1 parent e019661 commit 6c6fc6a

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
@@ -130,6 +130,8 @@ def _isnull_operator(a, b):
130130
# Operators like $exists: False, $ne, and $nor cannot be used in partial indexes.
131131
# So, indexes on null values (isnull=True|False) can't be implemented.
132132
"isnull": lambda a, b: {}, # noqa: ARG005
133+
# Partial indexes do not support the $regex expression.
134+
"contains": lambda a, b: {}, # noqa: ARG005
133135
}
134136

135137
display_name = "MongoDB"

0 commit comments

Comments
 (0)