0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

check matching regexes encapsulated directly in arrays as well

This commit is contained in:
Aaron 2009-05-26 14:05:41 -04:00
parent e7bc0e56d0
commit 17167cade8
2 changed files with 9 additions and 1 deletions

View File

@ -779,7 +779,7 @@ namespace mongo {
BSONElement f = i.next();
if ( f.eoo() )
break;
ret.insert( e );
ret.insert( f );
}
} else {
ret.insert( e );

View File

@ -11,6 +11,14 @@ t.drop();
t.save( { a: { b: "cde" } } );
assert.eq( 1, t.count( { 'a.b': /de/ } ) );
t.drop();
t.save( { a: { b: [ "cde" ] } } );
assert.eq( 1, t.count( { 'a.b': /de/ } ) );
t.drop();
t.save( { a: [ { b: "cde" } ] } );
assert.eq( 1, t.count( { 'a.b': /de/ } ) );
t.drop();
t.save( { a: [ { b: [ "cde" ] } ] } );
assert.eq( 1, t.count( { 'a.b': /de/ } ) );