-
Type: Bug
-
Resolution: Duplicate
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: Querying
-
ALL
Observed behavior: A simple query on _id with a positional operator projection on another field returns an incorrect result based on a missing positional match.
Expected behavior: Same behavior as if it is not a simple query on _id and there is no query field matching the positional operator - uassert.
Test
c = db.c; c.drop(); c.save( { _id:0, a:[ 1, 2 ] } ); // Throws error. c.find( {}, { 'a.$':1 } ).toArray(); // Should throw but instead returns a result I think is incorrect. printjson( c.find( { _id:0 }, { 'a.$':1 } ).toArray() );
We should also ensure that in cases where a positional operator is used, a match details is always available. We could check this with an assertion.
- duplicates
-
SERVER-10026 New query system
- Closed
- is related to
-
SERVER-6865 positional operator projection does not work with find and modify
- Closed