Method ReplaceRoot
ReplaceRoot<TInput, TIntermediate, TOutput>(PipelineDefinition<TInput, TIntermediate>, AggregateExpressionDefinition<TIntermediate, TOutput>)
Appends a $replaceRoot stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> ReplaceRoot<TInput, TIntermediate, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, AggregateExpressionDefinition<TIntermediate, TOutput> newRoot)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
newRootAggregateExpressionDefinition<TIntermediate, TOutput>The new root.
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.
ReplaceRoot<TInput, TIntermediate, TOutput>(PipelineDefinition<TInput, TIntermediate>, Expression<Func<TIntermediate, TOutput>>, ExpressionTranslationOptions)
Appends a $replaceRoot stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> ReplaceRoot<TInput, TIntermediate, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, Expression<Func<TIntermediate, TOutput>> newRoot, ExpressionTranslationOptions translationOptions = null)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
newRootExpression<Func<TIntermediate, TOutput>>The new root.
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.