[SERVER-64060] $lookup doesn't match an array with object that misses the local key to null Created: 28/Feb/22 Updated: 16/Mar/22 Resolved: 15/Mar/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Irina Yatsenko (Inactive) | Assignee: | Chris Harris |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | mql-semantics | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Operating System: | ALL | ||||||||||||
| Participants: | |||||||||||||
| Description |
|
| Comments |
| Comment by Yoon Soo Kim [ 15/Mar/22 ] | ||||
|
We decided to not change the classic engine behavior after having another meeting with the product team. It's mainly because missing matches null and we collect terminal values of the local path into an array. Resolved this as "Won't Fix". | ||||
| Comment by Irina Yatsenko (Inactive) [ 15/Mar/22 ] | ||||
|
Please take a look at https://jira.mongodb.org/browse/SERVER-64497. If we are open to changing how $lookup matches missing in the classic engine, it will be easier to implement in SBE, if we don't match missing to null at all, that is, _id:1 produces no matches. | ||||
| Comment by Yoon Soo Kim [ 14/Mar/22 ] | ||||
|
asya, A question on _Id: 1. Looking at your reply:
As of now, we always try to collect terminal values of local field path into an array and for _id: 1, we will get an empty array for the path "a.x" internally because "a.x" is missing. And IIUC, if we follow the same logic as What is your expected result for _id : 1? | ||||
| Comment by Irina Yatsenko (Inactive) [ 08/Mar/22 ] | ||||
|
The detail that confuses me is the following:
I filed this ticket because I was expecting the result to be [1, missing] for _id:3 | ||||
| Comment by Asya Kamsky [ 07/Mar/22 ] | ||||
|
It's correct that _id:3 does not match null since the value we are using as local field is {{ [ 1 ] }} and 1 does not match null. If we change empty array as |