Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-14781

Investigate changes in SERVER-59765: $dateAdd/$dateSubtract do not detect an overflow for time units of years/months/days

    XMLWordPrintableJSON

Details

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

      Attachments

        Activity

          People

            dave.cuthbert@mongodb.com Dave Cuthbert (Inactive)
            backlog-server-pm Backlog - Core Eng Program Management Team
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              2 years, 18 weeks, 6 days ago