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

$derivative should error when sortBy is unexpected type

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Minor Change
    • Query Optimization 2021-05-03, Query Optimization 2021-05-17

      When the sortBy field is a date, $derivative requires an outputUnit so it can convert a 1/time quantity to a unitless value. Conversely, when the sortBy field is unitless, $derivative requires outputUnit to be omitted.

      In both cases, we should throw an error instead of returning null. That should make it clearer how to fix a query where the presence/absence of 'outputUnit' doesn't match the data.

            Assignee:
            david.percy@mongodb.com David Percy
            Reporter:
            david.percy@mongodb.com David Percy
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: