Table of Contents

Method Project

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

Project<TResult>(IAggregateFluent<TResult>, ProjectionDefinition<TResult, BsonDocument>)

Appends a project stage to the pipeline.

public static IAggregateFluent<BsonDocument> Project<TResult>(this IAggregateFluent<TResult> aggregate, ProjectionDefinition<TResult, BsonDocument> projection)

Parameters

aggregate IAggregateFluent<TResult>

The aggregate.

projection ProjectionDefinition<TResult, BsonDocument>

The projection.

Returns

IAggregateFluent<BsonDocument>

The fluent aggregate interface.

Type Parameters

TResult

The type of the result.

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

Appends a project stage to the pipeline.

public static IAggregateFluent<TNewResult> Project<TResult, TNewResult>(this IAggregateFluent<TResult> aggregate, Expression<Func<TResult, TNewResult>> projection)

Parameters

aggregate IAggregateFluent<TResult>

The aggregate.

projection Expression<Func<TResult, TNewResult>>

The projection.

Returns

IAggregateFluent<TNewResult>

The fluent aggregate interface.

Type Parameters

TResult

The type of the result.

TNewResult

The type of the new result.