Table of Contents

Method Sort

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

Sort<TInput, TOutput>(PipelineDefinition<TInput, TOutput>, SortDefinition<TOutput>)

Appends a $sort stage to the pipeline.

public static PipelineDefinition<TInput, TOutput> Sort<TInput, TOutput>(this PipelineDefinition<TInput, TOutput> pipeline, SortDefinition<TOutput> sort)

Parameters

pipeline PipelineDefinition<TInput, TOutput>

The pipeline.

sort SortDefinition<TOutput>

The sort definition.

Returns

PipelineDefinition<TInput, TOutput>

A new pipeline with an additional stage.

Type Parameters

TInput

The type of the input documents.

TOutput

The type of the output documents.