Method ReplaceRoot

| MongoDB CSharp Driver API Reference (original) (raw)

Namespace

MongoDB.Driver

Assembly

MongoDB.Driver.dll

ReplaceRoot<TResult, TNewResult>(IAggregateFluent, 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

The aggregate.

newRoot Expression<Func<TResult, TNewResult>>

The new root.

Returns

IAggregateFluent

The fluent aggregate interface.

Type Parameters

TResult

The type of the result.

TNewResult

The type of the new result.