Table of Contents

Method ReplaceWith

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

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

Creates a $replaceWith stage.

public static PipelineStageDefinition<TInput, TOutput> ReplaceWith<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.

ReplaceWith<TInput, TOutput>(Expression<Func<TInput, TOutput>>)

Creates a $replaceWith stage.

public static PipelineStageDefinition<TInput, TOutput> ReplaceWith<TInput, TOutput>(Expression<Func<TInput, TOutput>> newRoot)

Parameters

newRoot Expression<Func<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.