|
For a query like, { 'a.b':{ $all:[ { $elemMatch:
{ c:1 }
} ] } }, a field named 'a.b' will not be identified if 'a' is an array containing an object with field 'b':
c = db.c;
|
c.drop();
|
|
c.save( { a:{ b:[ { c:1 } ] } } );
|
printjson( c.find( { 'a.b':{ $all:[ { $elemMatch:{ c:1 } } ] } } ).toArray() );
|
|
c.remove();
|
c.save( { a:[ { b:[ { c:1 } ] } ] } );
|
// Does not match because the implementation does not handle the case where 'a' is an array.
|
printjson( c.find( { 'a.b':{ $all:[ { $elemMatch:{ c:1 } } ] } } ).toArray() );
|
|