-
Type:
Bug
-
Resolution: Done
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: Aggregation Framework
-
None
-
ALL
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
ExpressionCompare::optimize() generates an ExpressionFieldRange for a $ne comparison against a constant. However ExpressionCompare does not properly encapsulate the semantics of not equals matching.
Test:
c = db.c; c.drop(); c.save( { a:1, b:1 } ); c.save( { a:2, b:1 } ); printjson( c.aggregate( { $project:{ z:{ $ne:[ '$a', 1 ] } } } ) ); printjson( c.aggregate( { $project:{ z:{ $ne:[ '$a', '$b' ] } } } ) );
Observed behavior
{ $ne:[ '$a', 1 ] } is always false
Actual behavior
should be true when the 'a' field value != 1.
- is duplicated by
-
SERVER-6148 aggregation $ne expression applied to constant returns incorrect result
-
- Closed
-