File tree Expand file tree Collapse file tree 3 files changed +15
-4
lines changed
reference/operator/aggregation Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change
1
+ ``from `` is optional, you can use a :pipeline: `$documents ` stage in a
2
+ :pipeline: `$lookup ` stage instead. For an example, see
3
+ :ref: `documents-lookup-example `.
Original file line number Diff line number Diff line change @@ -75,8 +75,10 @@ stage.
75
75
{ _id: { min: 10, max: 10 }, count: 1 }
76
76
]
77
77
78
- Use :pipeline:`$documents` with :pipeline:`$lookup`
79
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
78
+ .. _documents-lookup-example:
79
+
80
+ Use a ``$documents`` Stage in a ``$lookup`` Stage
81
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
80
82
81
83
Correlate documents in a collection with other data using
82
84
:pipeline:`$documents` to modify :pipeline:`$lookup` output.
Original file line number Diff line number Diff line change @@ -67,8 +67,10 @@ The :pipeline:`$lookup` takes a document with these fields:
67
67
68
68
- .. _lookup-eq-from:
69
69
70
- Specifies the collection in the *same* database to perform
71
- the join with.
70
+ Specifies the collection in the *same* database to perform the
71
+ join with.
72
+
73
+ .. include:: /includes/lookup-from.rst
72
74
73
75
Starting in MongoDB 5.1, the collection specified in the ``from``
74
76
parameter can be sharded.
@@ -186,6 +188,8 @@ The :pipeline:`$lookup` stage accepts a document with these fields:
186
188
Specifies the collection in the *same* database to perform the
187
189
join operation.
188
190
191
+ .. include:: /includes/lookup-from.rst
192
+
189
193
Starting in MongoDB 5.1, the ``from`` collection can be sharded.
190
194
191
195
* - :ref:`let <lookup-join-let>`
@@ -294,6 +298,8 @@ The :pipeline:`$lookup` accepts a document with these fields:
294
298
Specifies the foreign collection in the *same* database to join
295
299
to the local collection.
296
300
301
+ .. include:: /includes/lookup-from.rst
302
+
297
303
Starting in MongoDB 5.1, the ``from`` collection can be sharded.
298
304
299
305
* - :ref:`localField
You can’t perform that action at this time.
0 commit comments