Method Bucket
Bucket<TValue>(AggregateExpressionDefinition<TResult, TValue>, IEnumerable<TValue>, AggregateBucketOptions<TValue>)
Appends a $bucket stage to the pipeline.
IAggregateFluent<AggregateBucketResult<TValue>> Bucket<TValue>(AggregateExpressionDefinition<TResult, TValue> groupBy, IEnumerable<TValue> boundaries, AggregateBucketOptions<TValue> options = null)
Parameters
groupBy
AggregateExpression <TResult, TValue>Definition The expression providing the value to group by.
boundaries
IEnumerable<TValue>The bucket boundaries.
options
AggregateBucket <TValue>Options The options.
Returns
- IAggregate
Fluent <AggregateBucket <TValue>>Result The fluent aggregate interface.
Type Parameters
TValue
The type of the value.
Bucket<TValue, TNewResult>(AggregateExpressionDefinition<TResult, TValue>, IEnumerable<TValue>, ProjectionDefinition<TResult, TNewResult>, AggregateBucketOptions<TValue>)
Appends a $bucket stage to the pipeline with a custom projection.
IAggregateFluent<TNewResult> Bucket<TValue, TNewResult>(AggregateExpressionDefinition<TResult, TValue> groupBy, IEnumerable<TValue> boundaries, ProjectionDefinition<TResult, TNewResult> output, AggregateBucketOptions<TValue> options = null)
Parameters
groupBy
AggregateExpression <TResult, TValue>Definition The expression providing the value to group by.
boundaries
IEnumerable<TValue>The bucket boundaries.
output
ProjectionDefinition <TResult, TNewResult>The output projection.
options
AggregateBucket <TValue>Options The options.
Returns
- IAggregate
Fluent <TNewResult> The fluent aggregate interface.
Type Parameters
TValue
The type of the value.
TNewResult
The type of the new result.