[SERVER-37136] $bucketInterval for grouping data in intervaled buckets (eg. time series) Created: 14/Sep/18 Updated: 27/Dec/23 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Daniel Faust | Assignee: | Backlog - Query Integration |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | qi-timeseries | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Query Integration
|
| Participants: |
| Description |
|
The following StackOverflow question and answer raises the issue and provides a solution for this feature. Resample Time Series Data using Javascript and Mongodb
In addition of creating a bucket with predefined boundaries ($bucket), or one with autogenerated boundaries ($bucketAuto), it would be helpful to have a bucket stage which is given an upper and lower boundary, and the buckets are generated automatically at fixed, predefined intervals, for example
{{{}}
|
| Comments |
| Comment by David Storch [ 21/Sep/18 ] |
|
One nice way to achieve this might be to allow the existing $bucket stage to accept an expression, and expressing the boundaries with $range. |
| Comment by Daniel Faust [ 18/Sep/18 ] |
|
And maybe also an `inclusiveUpper: true|false`, maybe also add `inclusiveLower : true|false` For example, if `lower = 0`, `upper = 17` and `interval = 5`, then
|
| Comment by Daniel Faust [ 18/Sep/18 ] |
|
Also a growth direction would be useful. `growth: ASC|DESC`. For example, if `lower = 0`, `upper = 17` and `interval = 5`, then
|
| Comment by Nick Brewer [ 14/Sep/18 ] |
|
danielfaust Thanks for your request - I've passed this along to our Query team for consideration. -Nick |