Method Bucket
Bucket<TResult, TValue>(IAggregateFluent<TResult>, Expression<Func<TResult, TValue>>, IEnumerable<TValue>, AggregateBucketOptions<TValue>)
Appends a $bucket stage to the pipeline.
public static IAggregateFluent<AggregateBucketResult<TValue>> Bucket<TResult, TValue>(this IAggregateFluent<TResult> aggregate, Expression<Func<TResult, TValue>> groupBy, IEnumerable<TValue> boundaries, AggregateBucketOptions<TValue> options = null)
Parameters
aggregateIAggregateFluent<TResult>The aggregate.
groupByExpression<Func<TResult, TValue>>The expression providing the value to group by.
boundariesIEnumerable<TValue>The bucket boundaries.
optionsAggregateBucketOptions<TValue>The options.
Returns
- IAggregateFluent<AggregateBucketResult<TValue>>
The fluent aggregate interface.
Type Parameters
TResultThe type of the result.
TValueThe type of the value.
Bucket<TResult, TValue, TNewResult>(IAggregateFluent<TResult>, Expression<Func<TResult, TValue>>, IEnumerable<TValue>, Expression<Func<IGrouping<TValue, TResult>, TNewResult>>, AggregateBucketOptions<TValue>)
Appends a $bucket stage to the pipeline.
public static IAggregateFluent<TNewResult> Bucket<TResult, TValue, TNewResult>(this IAggregateFluent<TResult> aggregate, Expression<Func<TResult, TValue>> groupBy, IEnumerable<TValue> boundaries, Expression<Func<IGrouping<TValue, TResult>, TNewResult>> output, AggregateBucketOptions<TValue> options = null)
Parameters
aggregateIAggregateFluent<TResult>The aggregate.
groupByExpression<Func<TResult, TValue>>The expression providing the value to group by.
boundariesIEnumerable<TValue>The bucket boundaries.
outputExpression<Func<IGrouping<TValue, TResult>, TNewResult>>The output projection.
optionsAggregateBucketOptions<TValue>The options.
Returns
- IAggregateFluent<TNewResult>
The fluent aggregate interface.
Type Parameters
TResultThe type of the result.
TValueThe type of the value.
TNewResultThe type of the new result.