Table of Contents

Method BucketAutoForLinq2

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

BucketAutoForLinq2<TInput, TValue, TOutput>(Expression<Func<TInput, TValue>>, int, Expression<Func<IGrouping<TValue, TInput>, TOutput>>, AggregateBucketAutoOptions, ExpressionTranslationOptions)

Creates a $bucketAuto stage (this method can only be used with LINQ2).

public static PipelineStageDefinition<TInput, TOutput> BucketAutoForLinq2<TInput, TValue, TOutput>(Expression<Func<TInput, TValue>> groupBy, int buckets, Expression<Func<IGrouping<TValue, TInput>, TOutput>> output, AggregateBucketAutoOptions options = null, ExpressionTranslationOptions translationOptions = null)

Parameters

groupBy Expression<Func<TInput, TValue>>

The group by expression.

buckets int

The number of buckets.

output Expression<Func<IGrouping<TValue, TInput>, TOutput>>

The output projection.

options AggregateBucketAutoOptions

The options (optional).

translationOptions ExpressionTranslationOptions

The translation options.

Returns

PipelineStageDefinition<TInput, TOutput>

The stage.

Type Parameters

TInput

The type of the input documents.

TValue

The type of the output documents.

TOutput

The type of the output documents.