Method Unwind

| MongoDB CSharp Driver API Reference (original) (raw)

Namespace

MongoDB.Driver

Assembly

MongoDB.Driver.dll

Unwind(IAggregateFluent, FieldDefinition)

Appends an unwind stage to the pipeline.

public static IAggregateFluent<BsonDocument> Unwind<TResult>(this IAggregateFluent<TResult> aggregate, FieldDefinition<TResult> field)

Parameters

aggregate IAggregateFluent

The aggregate.

field FieldDefinition

The field to unwind.

Returns

IAggregateFluent<BsonDocument>

The fluent aggregate interface.

Type Parameters

TResult

The type of the result.

Unwind(IAggregateFluent, Expression<Func<TResult, object>>)

Appends an unwind stage to the pipeline.

public static IAggregateFluent<BsonDocument> Unwind<TResult>(this IAggregateFluent<TResult> aggregate, Expression<Func<TResult, object>> field)

Parameters

aggregate IAggregateFluent

The aggregate.

field Expression<Func<TResult, object>>

The field to unwind.

Returns

IAggregateFluent<BsonDocument>

The fluent aggregate interface.

Type Parameters

TResult

The type of the result.

Unwind<TResult, TNewResult>(IAggregateFluent, Expression<Func<TResult, object>>, IBsonSerializer)

Appends an unwind stage to the pipeline.

[Obsolete("Use the Unwind overload which takes an options parameter.")]
public static IAggregateFluent<TNewResult> Unwind<TResult, TNewResult>(this IAggregateFluent<TResult> aggregate, Expression<Func<TResult, object>> field, IBsonSerializer<TNewResult> newResultSerializer)

Parameters

aggregate IAggregateFluent

The aggregate.

field Expression<Func<TResult, object>>

The field to unwind.

newResultSerializer IBsonSerializer

The new result serializer.

Returns

IAggregateFluent

The fluent aggregate interface.

Type Parameters

TResult

The type of the result.

TNewResult

The type of the new result.

Unwind<TResult, TNewResult>(IAggregateFluent, Expression<Func<TResult, object>>, AggregateUnwindOptions)

Appends an unwind stage to the pipeline.

public static IAggregateFluent<TNewResult> Unwind<TResult, TNewResult>(this IAggregateFluent<TResult> aggregate, Expression<Func<TResult, object>> field, AggregateUnwindOptions<TNewResult> options = null)

Parameters

aggregate IAggregateFluent

The aggregate.

field Expression<Func<TResult, object>>

The field to unwind.

options AggregateUnwindOptions

The options.

Returns

IAggregateFluent

The fluent aggregate interface.

Type Parameters

TResult

The type of the result.

TNewResult

The type of the new result.