-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: 3.4.10
-
Component/s: Aggregation Framework
-
Query Optimization
The query comparison operators have a handled case for NaN
This behavior is not aligned with the Comparison Aggregation Operators and provides different result when used i.e. in $match pipeline stage or in a $project stage.
Query : src/mongo/db/matcher/expression_leaf.cpp
// Special case handling for NaN. NaN is equal to NaN but // otherwise always compares to false.
Pipeline: src/mongo/db/pipeline/value.cpp
return compareInts(rL._storage.intValue, rR._storage.intValue);