Problem Statement/Rationale
https://jira.mongodb.org/browse/SERVER-59765 added a check if values passed to $dateAdd / $dateSubtract would overflow. The update works correctly with numbers cast to Long, but fails with values cast using Int32
Steps to Reproduce
Run the following:
db.addSub.aggregate([{$project: {newDate: {"$dateAdd":
{"startDate" : Timestamp(0, 4294967295),
"unit" : "month",
"amount" : {$multiply: [Int32("2147483648")]},
"timezone" : "+1187" }}
}} ])
Expected Results
The value passed to Int32 is outside the signed range, it should be rejected
Actual Results
The value is accepted.
Additional Notes
- is related to
-
NODE-3640 Int32 constructor should coerce its argument
- Closed
- related to
-
MONGOSH-1048 Bump driver version to 4.1.4
- Closed