BucketAuto constructor

BucketAuto({
  1. required AggregationExpr groupBy,
  2. required int buckets,
  3. Map<String, Accumulator>? output,
  4. Granularity? granularity,
})

Creates $bucketAuto aggregation stage

  • groupBy - An expression to group documents by. To specify a field path use Field object.
  • buckets - A positive integer that specifies the number of buckets into which input documents are grouped.
  • output - Optional. A document that specifies the fields to include in the output documents in addition to the _id field. To specify the field to include, you must use accumulator expressions
  • granularity - Optional. A Granularity that specifies the preferred number series to use to ensure that the calculated boundary edges end on preferred round numbers or their powers of 10.

Implementation

BucketAuto(
    {required AggregationExpr groupBy,
    required int buckets,
    Map<String, Accumulator>? output,
    Granularity? granularity})
    : super(
          'bucketAuto',
          AEObject({
            'groupBy': groupBy,
            'buckets': buckets,
            if (output != null) 'output': AEObject(output),
            if (granularity != null) 'granularity': granularity
          }));