[SERVER-6001] key matching is not handled properly for the $elemMatch operator Created: 04/Jun/12  Updated: 11/Jul/16  Resolved: 09/Jun/12

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

Type: Bug Priority: Major - P3
Reporter: Aaron Staple Assignee: Aaron Staple
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-12024 re-implement $in in terms of $or Backlog
Operating System: ALL
Participants:

 Description   

Key matching is not implemented properly for $elemMatch. For now we should disable key matching with $elemMatch.

Test:

> c.drop()
false
> c.ensureIndex( { a:1 } )
c>c.save( { a:[ { b:1 } ] } )
> c.find( { a:{ $elemMatch:{ b:{ $gte:1 } } } } ).hint( { $natural:1 } )
{ "_id" : ObjectId("4fcd1f7c52eebdbb9f04430d"), "a" : [ { "b" : 1 } ] }
> c.find( { a:{ $elemMatch:{ b:{ $gte:1 } } } } ).hint( { a:1 } )
> 



 Comments   
Comment by auto [ 09/Jun/12 ]

Author:

{u'login': u'astaple', u'name': u'Aaron', u'email': u'aaron@10gen.com'}

Message: SERVER-4180 Fixes and cleanups for $elemMatch matching, including fix for SERVER-6001.
Branch: master
https://github.com/mongodb/mongo/commit/68775795d16f6a3854341f16d4cab32d1bc76830

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