[SERVER-7756] numeric named element selection semantics differ for regular expressions, $all Created: 25/Nov/12  Updated: 11/Jul/16  Resolved: 22/Oct/13

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

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

Issue Links:
Related
is related to SERVER-7385 Write named field extraction iterator... Closed
Operating System: ALL
Participants:

 Description   

The element selection semantics for a numeric field name within an array differ between regular expressions and other query operators. We should make regular expressions consistent with the other operators.

c = db.c;
c.drop();
 
c.save( { a:[ { 1:'x' }, 'y' ] } );
assert.eq( 1, c.count( { 'a.1':'x' } ) );
assert.eq( 1, c.count( { 'a.1':'y' } ) );
// Does not match, because arrays are not expanded to find nested numeric field names, when matching a regular expression.          
assert.eq( 1, c.count( { 'a.1':/x/ } ) );
assert.eq( 1, c.count( { 'a.1':/y/ } ) );

Similar behavior with $all, which also uses getFieldsDotted().



 Comments   
Comment by auto [ 22/Oct/13 ]

Author:

{u'username': u'erh', u'name': u'Eliot Horowitz', u'email': u'eliot@10gen.com'}

Message: SERVER-7756: add test, was fixed by matcher refactor
Branch: master
https://github.com/mongodb/mongo/commit/98bdc3025f4f0527cc09a90834cdecf6b7c235d8

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