Are there plans to allow expressions that evaluate to arrays of numbers for "boundaries"
in the "$bucket"
aggregation stage?
For example, to allow something like this?
{
$bucket: {
groupBy: "$year_born", // Field to group by
// boundaries: [ 1840, 1850, 1860, 1870, 1880 ], // Boundaries for the buckets
boundaries: { $range: [1840, 1890, 10] },
// or even just boundaries: "$myBoundaries"
default: "Other", // Bucket ID for documents which do not fall into a bucket
output: { // Output for each bucket
"count": { $sum: 1 },
"artists" :
{
$push: {
"name": { $concat: [ "$first_name", " ", "$last_name"] },
"year_born": "$year_born"
}
}
}
}
}