-
Type: Improvement
-
Resolution: Incomplete
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Aggregation Framework
-
None
In general we seem to support concatenation of multiple dates with strings but not addition of multiple dates.
Observed behavior: uassert if an attempt is made to add two dates as part of constant folding, even if the folded value would be unused because of a non constant string value.
Expected behavior: No uassert in this case.
Test:
c = db.c; c.drop(); c.save( { x:' ' } ); // No uassert when concatenating multiple constants. printjson( c.aggregate( { $project:{ a:{ $add:[ new Date(), ' ', new Date() ] } } } ) ); // uassert when concatenating date constants (constant folding) and a non constant string. printjson( c.aggregate( { $project:{ a:{ $add:[ new Date(), '$x', new Date() ] } } } ) );
- depends on
-
SERVER-6239 Better semantics for $add and $subtract with Dates
- Closed
- is related to
-
SERVER-6206 need a policy for incompatible types in operators in aggregation expressions
- Closed
-
SERVER-6240 Disable math with Dates in agg
- Closed