Method Group
Group<TInput, TIntermediate, TOutput>(PipelineDefinition<TInput, TIntermediate>, ProjectionDefinition<TIntermediate, TOutput>)
Appends a $group stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> Group<TInput, TIntermediate, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, ProjectionDefinition<TIntermediate, TOutput> group)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
groupProjectionDefinition<TIntermediate, TOutput>The group projection.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TOutputThe type of the output documents.
Group<TInput, TIntermediate>(PipelineDefinition<TInput, TIntermediate>, ProjectionDefinition<TIntermediate, BsonDocument>)
Appends a group stage to the pipeline.
public static PipelineDefinition<TInput, BsonDocument> Group<TInput, TIntermediate>(this PipelineDefinition<TInput, TIntermediate> pipeline, ProjectionDefinition<TIntermediate, BsonDocument> group)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
groupProjectionDefinition<TIntermediate, BsonDocument>The group projection.
Returns
- PipelineDefinition<TInput, BsonDocument>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
Group<TInput, TIntermediate, TKey, TOutput>(PipelineDefinition<TInput, TIntermediate>, Expression<Func<TIntermediate, TKey>>, Expression<Func<IGrouping<TKey, TIntermediate>, TOutput>>, ExpressionTranslationOptions)
Appends a group stage to the pipeline (this method can only be used with LINQ2).
public static PipelineDefinition<TInput, TOutput> Group<TInput, TIntermediate, TKey, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, Expression<Func<TIntermediate, TKey>> id, Expression<Func<IGrouping<TKey, TIntermediate>, TOutput>> group, ExpressionTranslationOptions translationOptions = null)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
idExpression<Func<TIntermediate, TKey>>The id.
groupExpression<Func<IGrouping<TKey, TIntermediate>, TOutput>>The group projection.
translationOptionsExpressionTranslationOptionsThe translation options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TKeyThe type of the key.
TOutputThe type of the output documents.
Remarks
This method can only be used with LINQ2 but that can't be verified until Render is called.