[SERVER-14877] Matcher incorrect on null equality query when using array index notation with embedded field Created: 13/Aug/14 Updated: 06/Dec/22 Resolved: 11/Mar/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | 2.6.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | J Rassi | Assignee: | Backlog - Query Team (Inactive) |
| Resolution: | Duplicate | Votes: | 2 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Assigned Teams: |
Query
|
||||||||||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||
| Description |
|
Queries of the form {"a.0.b": null} incorrectly match documents where "a" is an array such that the first element is a subdocument with a non-null value for "b". Regression since 2.4. Affects 2.6.0 through 2.6.4. Example repro:
|
| Comments |
| Comment by David Storch [ 13/Mar/19 ] | ||||||||
|
I've investigated this issue, and provided a thorough explanation for the observed behavior in this comment on SERVER-27442. Let's hold any further discussion of this issue on SERVER-27442 rather than here. | ||||||||
| Comment by Craig Homa [ 04/Mar/19 ] | ||||||||
|
Closed as a duplicate of SERVER-27442. | ||||||||
| Comment by J Rassi [ 13/Aug/14 ] | ||||||||
|
Interestingly, note also that the document from the example above, {a:[{b:1}]}, does match the query {"a.0": null} in both 2.4 and 2.6. However, it does not get returned when indexed, in both versions:
That is (unlike the shell session from the description) the above shell session exhibits the same behavior between 2.4.10 and 2.6.4. |