[SERVER-59308] Match After $lookup-$unwind not applied correctly to $lookup results Created: 11/Aug/21 Updated: 29/Oct/23 Resolved: 16/Sep/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | None |
| Fix Version/s: | 5.0.4, 5.1.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Patrick Meredith | Assignee: | Katherine Wu (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | query-director-triage | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | ALL | ||||||||
| Backport Requested: |
v5.0
|
||||||||
| Sprint: | QO 2021-09-20 | ||||||||
| Participants: | |||||||||
| Description |
|
This applies to 5.0.2-rc0 I have narrowed down that this is not an issue with matching on nested document fields in isolation (they work fine), and also, if the nested results from the unwound lookup result are projected into the root document and the match applied to the root document, it works correctly. Additionally, matches on the fields from the current document of the $lookup (rather than the $lookup result) work correctly. This is the specific situation, minimized, as far as I can tell. Here is a repo query with data (showing results in 4.4 and 5.0.2-rc0)
|
| Comments |
| Comment by Vivian Ge (Inactive) [ 06/Oct/21 ] |
|
Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you! |
| Comment by Githook User [ 24/Sep/21 ] |
|
Author: {'name': 'Katherine Wu', 'email': 'katherine.wu@mongodb.com', 'username': 'kaywux'}Message: (cherry picked from commit d5156d91a608a3b7cf30fbdb63a2d31783389a47) |
| Comment by Githook User [ 15/Sep/21 ] |
|
Author: {'name': 'Katherine Wu', 'email': 'katherine.wu@mongodb.com', 'username': 'kaywux'}Message: |
| Comment by Patrick Meredith [ 12/Aug/21 ] |
|
This problem also exists in 5.0.0 ga. |
| Comment by Patrick Meredith [ 11/Aug/21 ] |
|
My best guess is that we have an issue in the optimizer rewrites with dropping the $match, but that is not guaranteed to be the issue |