[DOCS-12271] Docs for SERVER-32308: Add the ability for a $lookup stage to execute on mongos against a sharded foreign collection Created: 13/Dec/18  Updated: 13/Nov/23  Resolved: 02/Jul/19

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: 4.1.7, Server_Docs_20231030, Server_Docs_20231106, Server_Docs_20231105, Server_Docs_20231113

Type: Task Priority: Major - P3
Reporter: Kay Kim (Inactive) Assignee: Kay Kim (Inactive)
Resolution: Gone away Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
documents SERVER-32308 Add the ability for a $lookup stage t... Closed
Participants:
Days since reply: 5 years, 8 weeks, 6 days ago
Epic Link: DOCS: 4.2 Server/Tools

 Description   

Description

Description:

Allows for localField/foreignField $lookup into a sharded collection.

Engineering Ticket Description:

In order to support $changeStreams "updateLookup" functionality (see the documentation here), the aggregation subsystem now has machinery for $lookup-like query execution on mongos.

We should extend this functionality to work for the $lookup stage itself:

  • When the foreign collection is sharded, split the pipeline such that the $lookup is part of the merging pipeline. Execute the merging pipeline on mongos, performing lookups across the network to the shards as needed.
  • If the foreign collection is not sharded, send the merging part of the pipeline to the primary shard and perform local lookups, just as we do in all existing versions of MongoDB.
  • If the merging part of the pipeline containing the $lookup cannot execute on mongos, raise an error to the application.
  • Support only localField/foreignField $lookup for now; adding support for $lookup with a sub-pipeline into a sharded foreign collection is future work.

Scope of changes

Impact to Other Docs

MVP (Work and Date)

Resources (Scope or Design Docs, Invision, etc.)


Generated at Thu Feb 08 08:04:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.