[SERVER-60800] Allow $search in $lookup/$unionWith Created: 19/Oct/21 Updated: 29/Oct/23 Resolved: 28/Feb/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 6.0.0-rc0 |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Charlie Swanson | Assignee: | Ruslan Abdulkhalikov (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Backport Requested: |
v5.2
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| Sprint: | QO 2021-12-27, QO 2022-01-10, QO 2022-01-24, QO 2022-02-07, QO 2022-02-21, QO 2022-03-07 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| Linked BF Score: | 179 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
Allow $search to be used as target of $lookup and $unionWith. This will provide a better user experience in $search and allow for compatibility with a wider range of use cases. |
| Comments |
| Comment by Daniele Tassone [ 18/Nov/22 ] |
|
Hi, I am using $search in $lookup. It might be useful for me to rely on $$correlated_variable defined in let: {}. Unfortunately, it is treated as literal string. Is there any plan to support it in the future? |
| Comment by Githook User [ 28/Feb/22 ] |
|
Author: {'name': 'Ruslan Abdulkhalikov', 'email': 'ruslan.abdulkhalikov@mongodb.com', 'username': 'rusabd1'}Message: |
| Comment by Githook User [ 28/Feb/22 ] |
|
Author: {'name': 'Ruslan Abdulkhalikov', 'email': 'ruslan.abdulkhalikov@mongodb.com', 'username': 'rusabd1'}Message: |
| Comment by Steve Tarzia [ 17/Feb/22 ] |
|
Also note that this ticket's work will not enable $searchMeta in $lookup/$unionWith. That will be added in https://jira.mongodb.org/browse/PM-2729 |
| Comment by Githook User [ 08/Feb/22 ] |
|
Author: {'name': 'ruslan.abdulkhalikov', 'email': 'ruslan.abdulkhalikov@mongodb.com', 'username': 'rusabd1'}Message: |
| Comment by Githook User [ 03/Feb/22 ] |
|
Author: {'name': 'Ruslan Abdulkhalikov', 'email': 'ruslan.abdulkhalikov@mongodb.com', 'username': 'rusabd1'}Message: |
| Comment by Pawel Terlecki [ 24/Dec/21 ] |
|
i thought about it more. we should actually allow $$SEARCH_META to be defined as a variable associated with the pipeline rooted in $search. if users want to merge $$SEARCH_META from subbranches for unionWith or lookup they should be able to do it explicitly |
| Comment by Charlie Swanson [ 21/Oct/21 ] |
|
pawel.terlecki it seems like we could do $searchMeta as well, yeah. Some interesting considerations from a team discussion on 10/21:
|
| Comment by Pawel Terlecki [ 19/Oct/21 ] |
|
Can we also enable $searchMeta? Say if one wants to union searches in 3 collections and get these 3 counts. |