Method Group
Group<TResult>(IAggregateFluent<TResult>, ProjectionDefinition<TResult, BsonDocument>)
Appends a group stage to the pipeline.
public static IAggregateFluent<BsonDocument> Group<TResult>(this IAggregateFluent<TResult> aggregate, ProjectionDefinition<TResult, BsonDocument> group)
Parameters
aggregateIAggregateFluent<TResult>The aggregate.
groupProjectionDefinition<TResult, BsonDocument>The group projection.
Returns
- IAggregateFluent<BsonDocument>
The fluent aggregate interface.
Type Parameters
TResultThe type of the result.
Group<TResult, TKey, TNewResult>(IAggregateFluent<TResult>, Expression<Func<TResult, TKey>>, Expression<Func<IGrouping<TKey, TResult>, TNewResult>>)
Appends a group stage to the pipeline.
public static IAggregateFluent<TNewResult> Group<TResult, TKey, TNewResult>(this IAggregateFluent<TResult> aggregate, Expression<Func<TResult, TKey>> id, Expression<Func<IGrouping<TKey, TResult>, TNewResult>> group)
Parameters
aggregateIAggregateFluent<TResult>The aggregate.
idExpression<Func<TResult, TKey>>The id.
groupExpression<Func<IGrouping<TKey, TResult>, TNewResult>>The group projection.
Returns
- IAggregateFluent<TNewResult>
The fluent aggregate interface.
Type Parameters
TResultThe type of the result.
TKeyThe type of the key.
TNewResultThe type of the new result.