Table of Contents

Method SortByCount

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

SortByCount<TResult, TKey>(IAggregateFluent<TResult>, Expression<Func<TResult, TKey>>)

Appends a sortByCount stage to the pipeline.

public static IAggregateFluent<AggregateSortByCountResult<TKey>> SortByCount<TResult, TKey>(this IAggregateFluent<TResult> aggregate, Expression<Func<TResult, TKey>> id)

Parameters

aggregate IAggregateFluent<TResult>

The aggregate.

id Expression<Func<TResult, TKey>>

The id.

Returns

IAggregateFluent<AggregateSortByCountResult<TKey>>

The fluent aggregate interface.

Type Parameters

TResult

The type of the result.

TKey

The type of the key.