Skip to content

Commit 702a518

Browse files
committed
Add docstring
1 parent ddf4d2e commit 702a518

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

django_mongodb_backend/aggregates.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def count(self, compiler, connection, resolve_inner_expression=False):
5252
# If distinct=True or resolve_inner_expression=False, sum the size of the
5353
# set.
5454
lhs_mql = process_lhs(self, compiler, connection, as_expr=True)
55+
# Wrap null results as an empty array.
5556
lhs_mql = {"$ifNull": [lhs_mql, []]}
5657
# None shouldn't be counted, so subtract 1 if it's present.
5758
exits_null = {"$cond": {"if": {"$in": [{"$literal": None}, lhs_mql]}, "then": -1, "else": 0}}

0 commit comments

Comments
 (0)