Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-57629

change $integral&$derivative argument from 'outputUnit' to 'unit'

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 5.0.0-rc5
    • Component/s: None
    • Labels:
      None
    • Backwards Compatibility:
      Minor Change
    • Operating System:
      ALL
    • Backport Requested:
      v5.0
    • Sprint:
      Query Optimization 2021-07-26

      Description

      In the $integral and the $derivative window functions, 'outputUnit' specifies how to express time deltas as a number. We originally called it 'outputUnit' to avoid a name collision with the 'unit' used for the window bounds.

      This name is confusing though, because often the measurements implicitly have a unit involving time. For example, suppose you have numbers representing meters/second, and times represented as a datetime. The result will have units of meters, so writing outputUnit: 'second' is counterintuitive.

      Now that the 'window' arguments are separate, we could go back to calling this argument just 'unit':

      {$integral: {
         input: "$rate",
         unit: "second"
       },
       window: {
         range: [-1, 0],
         unit: "hour"
       }
      }
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jacob.evans Jacob Evans
              Reporter:
              david.percy David Percy
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: