$dateAdd/$dateSubtract expressions do not detect an overflow for certain 'amount' values. 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" }};
- is documented by
-
DOCS-14781 Investigate changes in SERVER-59765: $dateAdd/$dateSubtract do not detect an overflow for time units of years/months/days
- Closed