Skip to content

Commit ce4e4df

Browse files
committed
Fix len
1 parent 3a0421b commit ce4e4df

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

django_mongodb_backend/fields/array.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,9 @@ def get_subquery_wrapping_pipeline(self, compiler, connection, field_name, expr)
326326
def as_mql(self, compiler, connection):
327327
lhs_mql = process_lhs(self, compiler, connection)
328328
value = process_rhs(self, compiler, connection)
329-
return {"$and": [{"$isArray": lhs_mql}, {"$size": {"$setIntersection": [value, lhs_mql]}}]}
329+
return {
330+
"$and": [{"$ne": [lhs_mql, None]}, {"$size": {"$setIntersection": [value, lhs_mql]}}]
331+
}
330332

331333

332334
@ArrayField.register_lookup

0 commit comments

Comments
 (0)