Table of Contents

Method BucketAutoForLinq2

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

BucketAutoForLinq2<TResult, TValue, TNewResult>(IAggregateFluent<TResult>, Expression<Func<TResult, TValue>>, int, Expression<Func<IGrouping<TValue, TResult>, TNewResult>>, AggregateBucketAutoOptions)

Appends a $bucketAuto stage to the pipeline (this method can only be used with LINQ2).

public static IAggregateFluent<TNewResult> BucketAutoForLinq2<TResult, TValue, TNewResult>(this IAggregateFluent<TResult> aggregate, Expression<Func<TResult, TValue>> groupBy, int buckets, Expression<Func<IGrouping<TValue, TResult>, TNewResult>> output, AggregateBucketAutoOptions options = null)

Parameters

aggregate IAggregateFluent<TResult>

The aggregate.

groupBy Expression<Func<TResult, TValue>>

The expression providing the value to group by.

buckets int

The number of buckets.

output Expression<Func<IGrouping<TValue, TResult>, TNewResult>>

The output projection.

options AggregateBucketAutoOptions

The options (optional).

Returns

IAggregateFluent<TNewResult>

The fluent aggregate interface.

Type Parameters

TResult

The type of the result.

TValue

The type of the value.

TNewResult

The type of the new result.