Table of Contents

Method ReplaceWith

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

ReplaceWith<TResult, TNewResult>(IAggregateFluent<TResult>, Expression<Func<TResult, TNewResult>>)

Appends a $replaceWith stage to the pipeline.

public static IAggregateFluent<TNewResult> ReplaceWith<TResult, TNewResult>(this IAggregateFluent<TResult> aggregate, Expression<Func<TResult, TNewResult>> newRoot)

Parameters

aggregate IAggregateFluent<TResult>

The aggregate.

newRoot Expression<Func<TResult, TNewResult>>

The new root.

Returns

IAggregateFluent<TNewResult>

The fluent aggregate interface.

Type Parameters

TResult

The type of the result.

TNewResult

The type of the new result.