bucket

fun <TExpression, Boundary> bucket(groupBy: TExpression, boundaries: List<Boundary>, options: BucketOptions = BucketOptions()): Bson

Creates a $bucket pipeline stage

Return

the $bucket pipeline stage

Parameters

the boundary type
groupBy

the criteria to group By

boundaries

the boundaries of the buckets

options

the optional values for the $bucket stage