[SERVER-64497] Implement proper semantics for matching missing of some terminals on the path Created: 14/Mar/22  Updated: 29/Oct/23  Resolved: 24/Mar/22

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

Type: Task Priority: Major - P3
Reporter: Irina Yatsenko (Inactive) Assignee: Irina Yatsenko (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-64483 Implement path handling of foreignFie... Closed
Related
related to SERVER-63368 $lookup matches empty arrays to null/... Closed
related to SERVER-64006 $lookup matches on paths through arra... Closed
Backwards Compatibility: Fully Compatible
Sprint: QE 2022-04-04
Participants:

 Description   

For SERVER-63690 I'm implementing the basic path handling that does not match the current semantics of the classic engine (see SERVER-64060).

The problem here is to distinguish between the set of key values that was empty due to a path that didn't traverse any arrays but resulted in missing (in classical it matches to null), vs a path that traversed arrays and all terminals were missing (in classical it matches to null because an empty array matches to null), vs a path that traverses arrays and some terminals are missing and others aren't (in classical this does not match to null), vs all terminals being empty arrays (per SERVER-63368 classical will produce no matches in this case)

In SBE it's easy to implement either:
1. Treat any missing terminal as null and match records with such terminals to null/missing (this will match to null when some of the terminals are missing but not all)
2. For empty set of key values (because neither of the terminals produced a non-missing value) produce no matches (this won't match to null a path with no arrays that terminates in missing)
3. Match empty set of key values (because neither of the terminals produced a non-missing value) to null (this will match to null empty arrays).



 Comments   
Comment by Irina Yatsenko (Inactive) [ 24/Mar/22 ]

Fixed with https://github.com/10gen/mongo/pull/4106 that has been merged as 623cc0c632f417039798cc59

Comment by Irina Yatsenko (Inactive) [ 17/Mar/22 ]

Will be done with https://github.com/10gen/mongo/pull/3910 for paths in local and with https://github.com/10gen/mongo/pull/4049 for paths in foreign.

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