Table of Contents

Method BucketAuto

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

BucketAuto<TValue>(AggregateExpressionDefinition<TResult, TValue>, int, AggregateBucketAutoOptions)

Appends a $bucketAuto stage to the pipeline.

IAggregateFluent<AggregateBucketAutoResult<TValue>> BucketAuto<TValue>(AggregateExpressionDefinition<TResult, TValue> groupBy, int buckets, AggregateBucketAutoOptions options = null)

Parameters

groupBy AggregateExpressionDefinition<TResult, TValue>

The expression providing the value to group by.

buckets int

The number of buckets.

options AggregateBucketAutoOptions

The options (optional).

Returns

IAggregateFluent<AggregateBucketAutoResult<TValue>>

The fluent aggregate interface.

Type Parameters

TValue

The type of the value.

BucketAuto<TValue, TNewResult>(AggregateExpressionDefinition<TResult, TValue>, int, ProjectionDefinition<TResult, TNewResult>, AggregateBucketAutoOptions)

Appends a $bucketAuto stage to the pipeline with a custom projection.

IAggregateFluent<TNewResult> BucketAuto<TValue, TNewResult>(AggregateExpressionDefinition<TResult, TValue> groupBy, int buckets, ProjectionDefinition<TResult, TNewResult> output, AggregateBucketAutoOptions options = null)

Parameters

groupBy AggregateExpressionDefinition<TResult, TValue>

The expression providing the value to group by.

buckets int

The number of buckets.

output ProjectionDefinition<TResult, TNewResult>

The output projection.

options AggregateBucketAutoOptions

The options (optional).

Returns

IAggregateFluent<TNewResult>

The fluent aggregate interface.

Type Parameters

TValue

The type of the value.

TNewResult

The type of the new result.