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

Add $minMaxScalar window function for removable window implementations

    • Type: Icon: New Feature New Feature
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Query Integration
    • Fully Compatible
    • 0

      As described in the linked syntax document. This should be an extension to $setWindowFields.

      Shorthand:

      $minMaxScaler: <numeric expression>
      

      Or extended:

      $minMaxScaler: {
        input: <numeric expression>,
        min: <constant numeric expression>,
        max: <constant numeric expression>
      }
      

      Using the defaults for min and max (0 and 1 respectively), given a sequence of numbers in the window
      X = x0, x1, … xn, this will calculate:

      minMaxScaler(xi) =(xi -min(X)) / (max(X) -min(X))

      Now adding parameters smin and smax, for the fully general case we get:

      minMaxScaler(xi, smin, smax) =((xi -min(X)) / (max(X) -min(X))*(smax-smin) +smin

      You can see that these new terms just adjust the value between 0 and 1 to be in the domain (smin, smax)

      For this ticket, only implement the removable window implementations of the window function, to break up how much scope this ticket covers. This means no left unbounded document windows will be supported. A follow up ticket will add in the removable window implementation.

            Assignee:
            joseph.shalabi@mongodb.com Joe Shalabi
            Reporter:
            charlie.swanson@mongodb.com Charlie Swanson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: