Skip to content

Commit f5d6107

Browse files
committed
docstring.
1 parent 63d0bdb commit f5d6107

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

django_mongodb/query.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,13 +157,18 @@ def join(self, compiler, connection):
157157
lookup_pipeline = [
158158
{
159159
"$lookup": {
160+
# The right-hand table to join.
160161
"from": self.table_name,
162+
# Define the current pipeline variables to be used in the match
163+
# expression of the pipeline.
161164
"let": {
162165
f"{parent_template}{i}": parent_field
163166
for i, parent_field in enumerate(lhs_fields)
164167
},
165168
"pipeline": [
166169
{
170+
# Match all the conditions: self.table_name.field1 = parent_table.field1
171+
# and self.table_name.field2 = parent_table.field2 and ...
167172
"$match": {
168173
"$expr": {
169174
"$and": [
@@ -174,6 +179,7 @@ def join(self, compiler, connection):
174179
}
175180
}
176181
],
182+
# Rename the output as table_alias.
177183
"as": self.table_alias,
178184
}
179185
},

0 commit comments

Comments
 (0)