[SERVER-11777] Null matching on fields in docs in arrays changed from 2.4 to 2.5 Created: 19/Nov/13  Updated: 09/Jul/16  Resolved: 20/Nov/13

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Andrew Emil (Inactive) Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: 26qa, nqf
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-12444 null equality matches on dotted queri... Closed
Operating System: ALL
Participants:

 Description   

Seems like in 2.5 there is a difference in matching null fields for arrays.

Quick repro of issue:

db.test.insert({a: [{b:1}, {c:1}]})
db.test.find({"a.b": null})

document is not found in 2.4.8, but is found in 2.5.5-pre (built morning of 11/19)

The way to think about this is that "there is some element in the array such that the predicate is true." In the example above, there is a "path" such that a.b is null and that is the sub-document element

{c:1}

.



 Comments   
Comment by Andrew Emil (Inactive) [ 19/Nov/13 ]

This same behavior seems to pop up when using operators as well. Example:

db.test.drop()
db.test.insert({a: [1]});
db.test.find({"a.a": {$nin: [null]}});

in 2.4.8 nothing is found, in 2.5.5-pre the inserted document is returned

Generated at Thu Feb 08 03:26:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.