Method SortByCount
SortByCount<TInput, TIntermediate, TValue>(PipelineDefinition<TInput, TIntermediate>, AggregateExpressionDefinition<TIntermediate, TValue>)
Appends a $sortByCount stage to the pipeline.
public static PipelineDefinition<TInput, AggregateSortByCountResult<TValue>> SortByCount<TInput, TIntermediate, TValue>(this PipelineDefinition<TInput, TIntermediate> pipeline, AggregateExpressionDefinition<TIntermediate, TValue> value)
Parameters
pipeline
PipelineDefinition <TInput, TIntermediate>The pipeline.
value
AggregateExpression <TIntermediate, TValue>Definition The value expression.
Returns
- Pipeline
Definition <TInput, AggregateSort <TValue>>ByCount Result A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TValue
The type of the values.
SortByCount<TInput, TIntermediate, TValue>(PipelineDefinition<TInput, TIntermediate>, Expression<Func<TIntermediate, TValue>>, ExpressionTranslationOptions)
Appends a sortByCount stage to the pipeline.
public static PipelineDefinition<TInput, AggregateSortByCountResult<TValue>> SortByCount<TInput, TIntermediate, TValue>(this PipelineDefinition<TInput, TIntermediate> pipeline, Expression<Func<TIntermediate, TValue>> value, ExpressionTranslationOptions translationOptions = null)
Parameters
pipeline
PipelineDefinition <TInput, TIntermediate>The pipeline.
value
Expression<Func<TIntermediate, TValue>>The value expression.
translationOptions
ExpressionTranslation Options The translation options.
Returns
- Pipeline
Definition <TInput, AggregateSort <TValue>>ByCount Result A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TValue
The type of the values.