[SERVER-36681] Change {$ne: null} semantics to be more intuitive Created: 15/Aug/18 Updated: 12/Sep/23 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Ian Boros | Assignee: | Backlog - Query Execution |
| Resolution: | Unresolved | Votes: | 2 |
| Labels: | asya, mql-semantics | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Assigned Teams: |
Query Execution
|
||||||||||||||||||||||||||||
| Backwards Compatibility: | Major Change | ||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||
| Description |
|
{$ne: null} has some counterintuitive behavior which has hurt us several times now:
That is, {$ne: null} doesn't necessarily return a subset of the things that {$exists: true} returns. This ticket is to track the work of changing the meaning of {$ne: null}. |
| Comments |
| Comment by Asya Kamsky [ 17/Aug/18 ] | |||
|
Just re-checked on latest - in fact, that was fixed via | |||
| Comment by Charlie Swanson [ 17/Aug/18 ] | |||
|
asya I think that behavior was a bug, and I think I fixed it when I implemented | |||
| Comment by Asya Kamsky [ 17/Aug/18 ] | |||
|
Note that it only returns this in absence of an index in versions 4.0 and earlier. With index on "a.b":
Without index:
Is this really $ne to null semantics or just a bug somewhere (similar to SERVER-36635)? |