Method Project
Project<TInput, TIntermediate, TOutput>(PipelineDefinition<TInput, TIntermediate>, ProjectionDefinition<TIntermediate, TOutput>)
Appends a $project stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> Project<TInput, TIntermediate, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, ProjectionDefinition<TIntermediate, TOutput> projection)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
projectionProjectionDefinition<TIntermediate, TOutput>The 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.
Exceptions
Project<TInput, TIntermediate>(PipelineDefinition<TInput, TIntermediate>, ProjectionDefinition<TIntermediate, BsonDocument>)
Appends a project stage to the pipeline.
public static PipelineDefinition<TInput, BsonDocument> Project<TInput, TIntermediate>(this PipelineDefinition<TInput, TIntermediate> pipeline, ProjectionDefinition<TIntermediate, BsonDocument> projection)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
projectionProjectionDefinition<TIntermediate, BsonDocument>The 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.
Project<TInput, TIntermediate, TOutput>(PipelineDefinition<TInput, TIntermediate>, Expression<Func<TIntermediate, TOutput>>, ExpressionTranslationOptions)
Appends a project stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> Project<TInput, TIntermediate, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, Expression<Func<TIntermediate, TOutput>> projection, ExpressionTranslationOptions translationOptions = null)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
projectionExpression<Func<TIntermediate, TOutput>>The 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.
TOutputThe type of the output documents.