Table of Contents

Method ReplaceRoot

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

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

Appends a $replaceRoot stage to the pipeline.

public static IAggregateFluent<TNewResult> ReplaceRoot<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.