Method SortByCount
SortByCount<TInput, TValue>(AggregateExpressionDefinition<TInput, TValue>)
Creates a $sortByCount stage.
public static PipelineStageDefinition<TInput, AggregateSortByCountResult<TValue>> SortByCount<TInput, TValue>(AggregateExpressionDefinition<TInput, TValue> value)
Parameters
valueAggregateExpressionDefinition<TInput, TValue>The value expression.
Returns
- PipelineStageDefinition<TInput, AggregateSortByCountResult<TValue>>
The stage.
Type Parameters
TInputThe type of the input documents.
TValueThe type of the values.
SortByCount<TInput, TValue>(Expression<Func<TInput, TValue>>, ExpressionTranslationOptions)
Creates a $sortByCount stage.
public static PipelineStageDefinition<TInput, AggregateSortByCountResult<TValue>> SortByCount<TInput, TValue>(Expression<Func<TInput, TValue>> value, ExpressionTranslationOptions translationOptions = null)
Parameters
valueExpression<Func<TInput, TValue>>The value.
translationOptionsExpressionTranslationOptionsThe translation options.
Returns
- PipelineStageDefinition<TInput, AggregateSortByCountResult<TValue>>
The stage.
Type Parameters
TInputThe type of the input documents.
TValueThe type of the values.