[SERVER-21929] $in doesn't find fields of type undef as null Created: 17/Dec/15 Updated: 06/Oct/21 Resolved: 14/Jun/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | None |
| Fix Version/s: | 5.0.0-rc2, 5.1.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | John Page | Assignee: | David Storch |
| Resolution: | Done | Votes: | 0 |
| Labels: | mql-semantics, query-44-grooming | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Backwards Compatibility: | Minor Change | ||||||||||||||||
| Operating System: | ALL | ||||||||||||||||
| Backport Requested: |
v5.0, v4.9, v4.4, v4.2
|
||||||||||||||||
| Sprint: | Query Execution 2021-06-14, Query Execution 2021-06-28 | ||||||||||||||||
| Participants: | |||||||||||||||||
| Linked BF Score: | 160 | ||||||||||||||||
| Description |
|
If you have a values which is undefined versus null - $in doesnt work
Finds all except wher v is ""
fails to find the record where x = 4 A workaround is
Which is ugly |
| 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 [ 15/Jun/21 ] | |||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {'name': 'David Storch', 'email': 'david.storch@mongodb.com', 'username': 'dstorch'}Message: (cherry picked from commit d75f3a8bb66ef1ef41bfd16eecd42c31f91c818b) | |||||||||||||||||||||||||||||||||||||||||||||||
| Comment by David Storch [ 14/Jun/21 ] | |||||||||||||||||||||||||||||||||||||||||||||||
|
I'm marking this as a minor breaking change, because it changes the semantics of $in queries if the user has stored the deprecated undefined BSON type. Use of undefined is strongly discouraged, and this type has been deprecated for many years, so this shouldn't have much of an impact in practice. I will quickly describe exactly what changed. In versions without this commit, an $in query involving the null value will not matched undefined, but it will match missing. After this commit, such predicates will match undefined in addition to null and missing:
A similar change applies for $lookup. Namely, a null from the left-hand side will now join with undefined in addition to null and missing:
| |||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 14/Jun/21 ] | |||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {'name': 'David Storch', 'email': 'david.storch@mongodb.com', 'username': 'dstorch'}Message: | |||||||||||||||||||||||||||||||||||||||||||||||
| Comment by John Page [ 17/Dec/15 ] | |||||||||||||||||||||||||||||||||||||||||||||||
|
Version was 3.2 |