Table of Contents

Method Project

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

Project<TInput, TOutput>(ProjectionDefinition<TInput, TOutput>)

Creates a $project stage.

public static PipelineStageDefinition<TInput, TOutput> Project<TInput, TOutput>(ProjectionDefinition<TInput, TOutput> projection)

Parameters

projection ProjectionDefinition<TInput, TOutput>

The projection.

Returns

PipelineStageDefinition<TInput, TOutput>

The stage.

Type Parameters

TInput

The type of the input documents.

TOutput

The type of the output documents.

Project<TInput>(ProjectionDefinition<TInput, BsonDocument>)

Creates a $project stage.

public static PipelineStageDefinition<TInput, BsonDocument> Project<TInput>(ProjectionDefinition<TInput, BsonDocument> projection)

Parameters

projection ProjectionDefinition<TInput, BsonDocument>

The projection.

Returns

PipelineStageDefinition<TInput, BsonDocument>

The stage.

Type Parameters

TInput

The type of the input documents.

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

Creates a $project stage.

public static PipelineStageDefinition<TInput, TOutput> Project<TInput, TOutput>(Expression<Func<TInput, TOutput>> projection)

Parameters

projection Expression<Func<TInput, TOutput>>

The projection.

Returns

PipelineStageDefinition<TInput, TOutput>

The stage.

Type Parameters

TInput

The type of the input documents.

TOutput

The type of the output documents.