[SERVER-56249] $derivative should error when sortBy is unexpected type Created: 21/Apr/21 Updated: 29/Oct/23 Resolved: 05/May/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 5.0.0-rc0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | David Percy | Assignee: | David Percy |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Minor Change | ||||||||
| Sprint: | Query Optimization 2021-05-03, Query Optimization 2021-05-17 | ||||||||
| Participants: | |||||||||
| Description |
|
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. |
| Comments |
| Comment by Githook User [ 05/May/21 ] |
|
Author: {'name': 'David Percy', 'email': 'david.percy@mongodb.com', 'username': 'dpercy'}Message: |