Skip to content

Commit 63d0bdb

Browse files
committed
docstring.
1 parent 46fe9d5 commit 63d0bdb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

django_mongodb/query.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,13 @@ def join(self, compiler, connection):
178178
}
179179
},
180180
]
181+
182+
# To avoid missing data when using the unwind operator,
183+
# an empty collection should be added if the join is not an inner join.
184+
# For inner joins, rows with empty arrays are removed,
185+
# as the unwind operator unrolls or unnests the array and removes the row if it is empty.
186+
# This is the expected behavior for inner joins.
187+
# However, for left outer joins (LOUTER), an empty collection is returned instead.
181188
if self.join_type != INNER:
182189
lookup_pipeline.append(
183190
{

0 commit comments

Comments
 (0)