Skip to content

Commit c3311ee

Browse files
jason-price-mongodbjason-price-mongodb
andauthored
DOCSP-24712 lookup updates (FORPORT) (#1880)
* DOCSP-24951 regex updates * DOCSP-24951 regex updates * DOCSP-24712 lookup updates (#1733) * DOCSP-24712-lookup-updates * DOCSP-24712-lookup-updates * DOCSP-24712-lookup-updates * DOCSP-24712-lookup-updates * DOCSP-24712-lookup-updates * DOCSP-24712-lookup-updates * DOCSP-24712-lookup-updates Co-authored-by: jason-price-mongodb <[email protected]> Co-authored-by: jason-price-mongodb <[email protected]>
1 parent 1a22ac7 commit c3311ee

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

source/includes/lookup-from.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
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`.

source/reference/operator/aggregation/documents.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,10 @@ stage.
7575
{ _id: { min: 10, max: 10 }, count: 1 }
7676
]
7777

78-
Use :pipeline:`$documents` with :pipeline:`$lookup`
79-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
78+
.. _documents-lookup-example:
79+
80+
Use a ``$documents`` Stage in a ``$lookup`` Stage
81+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8082

8183
Correlate documents in a collection with other data using
8284
:pipeline:`$documents` to modify :pipeline:`$lookup` output.

source/reference/operator/aggregation/lookup.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,10 @@ The :pipeline:`$lookup` takes a document with these fields:
6767

6868
- .. _lookup-eq-from:
6969

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
7274

7375
Starting in MongoDB 5.1, the collection specified in the ``from``
7476
parameter can be sharded.
@@ -186,6 +188,8 @@ The :pipeline:`$lookup` stage accepts a document with these fields:
186188
Specifies the collection in the *same* database to perform the
187189
join operation.
188190

191+
.. include:: /includes/lookup-from.rst
192+
189193
Starting in MongoDB 5.1, the ``from`` collection can be sharded.
190194

191195
* - :ref:`let <lookup-join-let>`
@@ -294,6 +298,8 @@ The :pipeline:`$lookup` accepts a document with these fields:
294298
Specifies the foreign collection in the *same* database to join
295299
to the local collection.
296300

301+
.. include:: /includes/lookup-from.rst
302+
297303
Starting in MongoDB 5.1, the ``from`` collection can be sharded.
298304

299305
* - :ref:`localField

0 commit comments

Comments
 (0)