[SERVER-14406] Differences in null matching between 2.4 and 2.6 Created: 01/Jul/14  Updated: 10/Dec/14  Resolved: 02/Jul/14

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

Type: Bug Priority: Major - P3
Reporter: Mark Chapman Assignee: Ramon Fernandez Marina
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-12444 null equality matches on dotted queri... Closed
is duplicated by NODE-208 Discrepancy between 2.4 and 2.6 behav... Closed
Operating System: ALL
Steps To Reproduce:

This script prints 1 in 2.4, and 0 in 2.6:

db.foo.drop()
db.foo.insert({ data: [] })
db.foo.find({ 'data.item': { $in: ['abc', null] } }).count()

Participants:

 Description   

Finding null in an array field used to return documents with empty arrays and no longer does. NODE-208 describes the problem in more detail (I wrongly
thought it was a driver or Mongoose issue).



 Comments   
Comment by Ramon Fernandez Marina [ 02/Jul/14 ]

markc, this behavior change was part of the rewrite of the query engine in 2.6, which included cleaning up areas were 2.4 was erroneous or inconsistent. In this particular case, null now only matches null, and not missing array fields. This new behavior is documented here.

If you want to elaborate of what you'd like your application to do we may be able to suggest an approach that works with 2.6. Remember that for MongoDB-related support discussion we recommend you post on the mongodb-users group or Stack Overflow with the mongodb tag.

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