[SERVER-65900] Initial implementation of $lookup Created: 22/Apr/22  Updated: 29/Oct/23  Resolved: 25/Apr/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.1.0-rc0

Type: New Feature Priority: Major - P3
Reporter: Svilen Mihaylov (Inactive) Assignee: Svilen Mihaylov (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Participants:

 Description   
  1. Support optimization for BInaryJoin.
  2. Translate $lookup into a combination of BinaryJoin, Group, and Unwind.

This is an *experimental* implementation of $lookup. To achieve fully compatible implementation we need the following:
1. Add support for unwind to emit not just the array elements, but in addition the array itself. Such unwinding needs to occur on the inner side in order to match the left side both against the elements and the array itself. The inner side would perform a regular unwind.
2. Add support for left outer join. Currently we only results when there is a match.
3. Add ability to generate unique values (sequential or otherwise) in order to eliminate reliance of _id. This can be achieved for example via a stateful function. Currently, after joining the unwound elements, we perform a de-duplication based on _id to determine which corresponding documents match.

 



 Comments   
Comment by Githook User [ 25/Apr/22 ]

Author:

{'name': 'Svilen Mihaylov', 'email': 'svilen.mihaylov@mongodb.com', 'username': 'smihaylov-mongodb'}

Message: SERVER-65900 Initial implementation of $lookup
Branch: master
https://github.com/mongodb/mongo/commit/af7466641230ada452d552c45fc5c0d8c5189178

Generated at Thu Feb 08 06:03:56 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.