Table of Contents

Method SortByCount

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

SortByCount<TInput, TValue>(AggregateExpressionDefinition<TInput, TValue>)

Creates a $sortByCount stage.

public static PipelineStageDefinition<TInput, AggregateSortByCountResult<TValue>> SortByCount<TInput, TValue>(AggregateExpressionDefinition<TInput, TValue> value)

Parameters

value AggregateExpressionDefinition<TInput, TValue>

The value expression.

Returns

PipelineStageDefinition<TInput, AggregateSortByCountResult<TValue>>

The stage.

Type Parameters

TInput

The type of the input documents.

TValue

The type of the values.

SortByCount<TInput, TValue>(Expression<Func<TInput, TValue>>)

Creates a $sortByCount stage.

public static PipelineStageDefinition<TInput, AggregateSortByCountResult<TValue>> SortByCount<TInput, TValue>(Expression<Func<TInput, TValue>> value)

Parameters

value Expression<Func<TInput, TValue>>

The value.

Returns

PipelineStageDefinition<TInput, AggregateSortByCountResult<TValue>>

The stage.

Type Parameters

TInput

The type of the input documents.

TValue

The type of the values.