[SERVER-6148] aggregation $ne expression applied to constant returns incorrect result Created: 20/Jun/12  Updated: 20/Jun/12  Resolved: 20/Jun/12

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Aaron Staple Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-6147 aggregation $ne expression applied to... Closed
Operating System: ALL
Participants:

 Description   

ExpressionCompare::optimize() generates an ExpressionFieldRange for a $ne comparison against a constant. However ExpressionFieldRange 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' ] } } } ) );



 Comments   
Comment by Aaron Staple [ 20/Jun/12 ]

Note this is a duplicate of SERVER-6147. Accidentally created a duplicate ticket due to jira issues.

Generated at Thu Feb 08 03:10:53 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.