Files
mongo/jstests/core/write/update
HanaPearlman 2c808c0fd7 SERVER-81378: Make comparison to null via MatchExpression $eq and $in not match undefined (#19523)
[SERVER-81378](https://jira.mongodb.org/browse/SERVER-81378): Make
comparison to null via MatchExpression $eq and $in not match undefined.

Previously, queries like {a: {$eq: null}} matched documents including,
among others, {a: null} and {a: undefined}. This change makes it so that
comparison to null via MatchExpression $eq and $in does not match
documents like the latter. By extension, classic $lookup behavior is
also changed so that null local fields do not match undefined foreign
fields (this was already the case for $lookup executed in SBE). This
commit does not affect the behavior of agg expressions, which have their
own, different semantics for undefined values.

As a result of this change, index scan plans for comparison to null
queries can look different. For example, query {a: {$eq: null}} using
index {a: 1} will only have index bounds for the null interval, rather
than both the null and undefined intervals.

GitOrigin-RevId: 496fd240a87e96bb9a46db9be2610335a002d283
2024-03-05 23:02:49 +00:00
..