-
Type: Task
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Labels:None
Downstream Change Summary
Tightened $dateAdd/$dateAdd overflow detection - on any 'amount' and 'unit' values the expressions now either return a correct result or an error, if the expression result is not representable as a date (the result absolute value is too large to fit into the Date type).
Description of Linked Ticket
$dateAdd/$dateSubtract expressions do not detect an overflow for time units of years/months/days. A result is undefined in such cases. An example of an expression that overflows:
{"$dateAdd": {"startDate" : Timestamp(0, 4294967295), "unit" : "month", "amount" : {$multiply: [NumberLong("314159265358979383")]}, "timezone" : "+1187" }};
- documents
-
SERVER-59765 $dateAdd/$dateSubtract do not detect an overflow for certain 'amount' values
- Closed