|
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().
|