[DOCS-14781] Investigate changes in SERVER-59765: $dateAdd/$dateSubtract do not detect an overflow for time units of years/months/days Created: 09/Sep/21  Updated: 13/Nov/23  Resolved: 30/Sep/21

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: 5.0.4, 5.1.0-rc0, Server_Docs_20231030, Server_Docs_20231106, Server_Docs_20231105, Server_Docs_20231113

Type: Task Priority: Major - P3
Reporter: Backlog - Core Eng Program Management Team Assignee: Dave Cuthbert (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
documents SERVER-59765 $dateAdd/$dateSubtract do not detect ... Closed
Participants:
Days since reply: 2 years, 18 weeks, 6 days ago
Epic Link: DOCSP-14300

 Description   
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" }};



 Comments   
Comment by Githook User [ 30/Sep/21 ]

Author:

{'name': 'Dave Cuthbert', 'email': 'dave.cuthbert@mongodb.com', 'username': 'davemungo'}

Message: DOCS-14781 Detect time unit overflow dateSubtract/Add
Branch: master
https://github.com/mongodb/docs/commit/78a7787fc524ed499a7f9ed5c3cbccdd5c7da3bd

Comment by PM Bot [ 09/Sep/21 ]

Downstream changes updated for upstream SERVER-59765:
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).

Generated at Thu Feb 08 08:11:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.