Method BucketAutoForLinq2
BucketAutoForLinq2<TInput, TIntermediate, TValue, TOutput>(PipelineDefinition<TInput, TIntermediate>, Expression<Func<TIntermediate, TValue>>, int, Expression<Func<IGrouping<TValue, TIntermediate>, TOutput>>, AggregateBucketAutoOptions, ExpressionTranslationOptions)
Appends a $bucketAuto stage to the pipeline (this method can only be used with LINQ2).
public static PipelineDefinition<TInput, TOutput> BucketAutoForLinq2<TInput, TIntermediate, TValue, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, Expression<Func<TIntermediate, TValue>> groupBy, int buckets, Expression<Func<IGrouping<TValue, TIntermediate>, TOutput>> output, AggregateBucketAutoOptions options = null, ExpressionTranslationOptions translationOptions = null)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
groupByExpression<Func<TIntermediate, TValue>>The group by expression.
bucketsintThe number of buckets.
outputExpression<Func<IGrouping<TValue, TIntermediate>, TOutput>>The output projection.
optionsAggregateBucketAutoOptionsThe options (optional).
translationOptionsExpressionTranslationOptionsThe translation options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TValueThe type of the value.
TOutputThe type of the output documents.