[SERVER-12125] indexed elemMatch query incorrectly matches non-array field Created: 16/Dec/13  Updated: 11/Jul/16  Resolved: 16/Dec/13

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

Type: Bug Priority: Major - P3
Reporter: Benety Goh Assignee: Benety Goh
Resolution: Done Votes: 0
Labels: query_triage
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

git hash 6902c6b643f645613f231bcde4bf2b1a86f63c21


Attachments: File server12125.js    
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

Using a collection with these documents:

{a: 4}
{a: [4]}

and index:

{a: 1}

The query

{a: ${elemMatch: {$gt: 3}}}

is returning both documents when it should match only

{a: [4]}



 Comments   
Comment by Githook User [ 16/Dec/13 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-12125 require fetch on $elemMatch value expressions
Branch: master
https://github.com/mongodb/mongo/commit/60a62aabd8b5301da37b05641709c12ee1b17baa

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