Table of Contents

Method ReplaceRoot

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

ReplaceRoot<TInput, TOutput>(AggregateExpressionDefinition<TInput, TOutput>)

Creates a $replaceRoot stage.

public static PipelineStageDefinition<TInput, TOutput> ReplaceRoot<TInput, TOutput>(AggregateExpressionDefinition<TInput, TOutput> newRoot)

Parameters

newRoot AggregateExpressionDefinition<TInput, TOutput>

The new root.

Returns

PipelineStageDefinition<TInput, TOutput>

The stage.

Type Parameters

TInput

The type of the input documents.

TOutput

The type of the output documents.

ReplaceRoot<TInput, TOutput>(Expression<Func<TInput, TOutput>>, ExpressionTranslationOptions)

Creates a $replaceRoot stage.

public static PipelineStageDefinition<TInput, TOutput> ReplaceRoot<TInput, TOutput>(Expression<Func<TInput, TOutput>> newRoot, ExpressionTranslationOptions translationOptions = null)

Parameters

newRoot Expression<Func<TInput, TOutput>>

The new root.

translationOptions ExpressionTranslationOptions

The translation options.

Returns

PipelineStageDefinition<TInput, TOutput>

The stage.

Type Parameters

TInput

The type of the input documents.

TOutput

The type of the output documents.