Class PipelineStageDefinitionBuilder
Methods for building pipeline stages.
public static class PipelineStageDefinitionBuilder
- Inheritance
-
PipelineStageDefinitionBuilder
- Inherited Members
Methods
BucketAutoForLinq2<TInput, TValue, TOutput>(Expression<Func<TInput, TValue>>, int, Expression<Func<IGrouping<TValue, TInput>, TOutput>>, AggregateBucketAutoOptions, ExpressionTranslationOptions)
Creates a $bucketAuto stage (this method can only be used with LINQ2).
public static PipelineStageDefinition<TInput, TOutput> BucketAutoForLinq2<TInput, TValue, TOutput>(Expression<Func<TInput, TValue>> groupBy, int buckets, Expression<Func<IGrouping<TValue, TInput>, TOutput>> output, AggregateBucketAutoOptions options = null, ExpressionTranslationOptions translationOptions = null)
Parameters
groupByExpression<Func<TInput, TValue>>The group by expression.
bucketsintThe number of buckets.
outputExpression<Func<IGrouping<TValue, TInput>, TOutput>>The output projection.
optionsAggregateBucketAutoOptionsThe options (optional).
translationOptionsExpressionTranslationOptionsThe translation options.
Returns
- PipelineStageDefinition<TInput, TOutput>
The stage.
Type Parameters
TInputThe type of the input documents.
TValueThe type of the output documents.
TOutputThe type of the output documents.
BucketAuto<TInput, TValue>(AggregateExpressionDefinition<TInput, TValue>, int, AggregateBucketAutoOptions)
Creates a $bucketAuto stage.
public static PipelineStageDefinition<TInput, AggregateBucketAutoResult<TValue>> BucketAuto<TInput, TValue>(AggregateExpressionDefinition<TInput, TValue> groupBy, int buckets, AggregateBucketAutoOptions options = null)
Parameters
groupByAggregateExpressionDefinition<TInput, TValue>The group by expression.
bucketsintThe number of buckets.
optionsAggregateBucketAutoOptionsThe options.
Returns
- PipelineStageDefinition<TInput, AggregateBucketAutoResult<TValue>>
The stage.
Type Parameters
TInputThe type of the input documents.
TValueThe type of the values.
BucketAuto<TInput, TValue>(Expression<Func<TInput, TValue>>, int, AggregateBucketAutoOptions, ExpressionTranslationOptions)
Creates a $bucketAuto stage.
public static PipelineStageDefinition<TInput, AggregateBucketAutoResult<TValue>> BucketAuto<TInput, TValue>(Expression<Func<TInput, TValue>> groupBy, int buckets, AggregateBucketAutoOptions options = null, ExpressionTranslationOptions translationOptions = null)
Parameters
groupByExpression<Func<TInput, TValue>>The group by expression.
bucketsintThe number of buckets.
optionsAggregateBucketAutoOptionsThe options (optional).
translationOptionsExpressionTranslationOptionsThe translation options.
Returns
- PipelineStageDefinition<TInput, AggregateBucketAutoResult<TValue>>
The stage.
Type Parameters
TInputThe type of the input documents.
TValueThe type of the value.
BucketAuto<TInput, TValue, TOutput>(AggregateExpressionDefinition<TInput, TValue>, int, ProjectionDefinition<TInput, TOutput>, AggregateBucketAutoOptions)
Creates a $bucketAuto stage.
public static PipelineStageDefinition<TInput, TOutput> BucketAuto<TInput, TValue, TOutput>(AggregateExpressionDefinition<TInput, TValue> groupBy, int buckets, ProjectionDefinition<TInput, TOutput> output, AggregateBucketAutoOptions options = null)
Parameters
groupByAggregateExpressionDefinition<TInput, TValue>The group by expression.
bucketsintThe number of buckets.
outputProjectionDefinition<TInput, TOutput>The output projection.
optionsAggregateBucketAutoOptionsThe options.
Returns
- PipelineStageDefinition<TInput, TOutput>
The stage.
Type Parameters
TInputThe type of the input documents.
TValueThe type of the values.
TOutputThe type of the output documents.
BucketAuto<TInput, TValue, TOutput>(Expression<Func<TInput, TValue>>, int, Expression<Func<IGrouping<AggregateBucketAutoResultId<TValue>, TInput>, TOutput>>, AggregateBucketAutoOptions, ExpressionTranslationOptions)
Creates a $bucketAuto stage (this overload can only be used with LINQ3).
public static PipelineStageDefinition<TInput, TOutput> BucketAuto<TInput, TValue, TOutput>(Expression<Func<TInput, TValue>> groupBy, int buckets, Expression<Func<IGrouping<AggregateBucketAutoResultId<TValue>, TInput>, TOutput>> output, AggregateBucketAutoOptions options = null, ExpressionTranslationOptions translationOptions = null)
Parameters
groupByExpression<Func<TInput, TValue>>The group by expression.
bucketsintThe number of buckets.
outputExpression<Func<IGrouping<AggregateBucketAutoResultId<TValue>, TInput>, TOutput>>The output projection.
optionsAggregateBucketAutoOptionsThe options (optional).
translationOptionsExpressionTranslationOptionsThe translation options.
Returns
- PipelineStageDefinition<TInput, TOutput>
The stage.
Type Parameters
TInputThe type of the input documents.
TValueThe type of the output documents.
TOutputThe type of the output documents.
Bucket<TInput, TValue>(AggregateExpressionDefinition<TInput, TValue>, IEnumerable<TValue>, AggregateBucketOptions<TValue>)
Creates a $bucket stage.
public static PipelineStageDefinition<TInput, AggregateBucketResult<TValue>> Bucket<TInput, TValue>(AggregateExpressionDefinition<TInput, TValue> groupBy, IEnumerable<TValue> boundaries, AggregateBucketOptions<TValue> options = null)
Parameters
groupByAggregateExpressionDefinition<TInput, TValue>The group by expression.
boundariesIEnumerable<TValue>The boundaries.
optionsAggregateBucketOptions<TValue>The options.
Returns
- PipelineStageDefinition<TInput, AggregateBucketResult<TValue>>
The stage.
Type Parameters
TInputThe type of the input documents.
TValueThe type of the values.
Bucket<TInput, TValue>(Expression<Func<TInput, TValue>>, IEnumerable<TValue>, AggregateBucketOptions<TValue>, ExpressionTranslationOptions)
Creates a $bucket stage.
public static PipelineStageDefinition<TInput, AggregateBucketResult<TValue>> Bucket<TInput, TValue>(Expression<Func<TInput, TValue>> groupBy, IEnumerable<TValue> boundaries, AggregateBucketOptions<TValue> options = null, ExpressionTranslationOptions translationOptions = null)
Parameters
groupByExpression<Func<TInput, TValue>>The group by expression.
boundariesIEnumerable<TValue>The boundaries.
optionsAggregateBucketOptions<TValue>The options.
translationOptionsExpressionTranslationOptionsThe translation options.
Returns
- PipelineStageDefinition<TInput, AggregateBucketResult<TValue>>
The stage.
Type Parameters
TInputThe type of the input documents.
TValueThe type of the values.
Bucket<TInput, TValue, TOutput>(AggregateExpressionDefinition<TInput, TValue>, IEnumerable<TValue>, ProjectionDefinition<TInput, TOutput>, AggregateBucketOptions<TValue>)
Creates a $bucket stage.
public static PipelineStageDefinition<TInput, TOutput> Bucket<TInput, TValue, TOutput>(AggregateExpressionDefinition<TInput, TValue> groupBy, IEnumerable<TValue> boundaries, ProjectionDefinition<TInput, TOutput> output, AggregateBucketOptions<TValue> options = null)
Parameters
groupByAggregateExpressionDefinition<TInput, TValue>The group by expression.
boundariesIEnumerable<TValue>The boundaries.
outputProjectionDefinition<TInput, TOutput>The output projection.
optionsAggregateBucketOptions<TValue>The options.
Returns
- PipelineStageDefinition<TInput, TOutput>
The stage.
Type Parameters
TInputThe type of the input documents.
TValueThe type of the values.
TOutputThe type of the output documents.
Bucket<TInput, TValue, TOutput>(Expression<Func<TInput, TValue>>, IEnumerable<TValue>, Expression<Func<IGrouping<TValue, TInput>, TOutput>>, AggregateBucketOptions<TValue>, ExpressionTranslationOptions)
Creates a $bucket stage.
public static PipelineStageDefinition<TInput, TOutput> Bucket<TInput, TValue, TOutput>(Expression<Func<TInput, TValue>> groupBy, IEnumerable<TValue> boundaries, Expression<Func<IGrouping<TValue, TInput>, TOutput>> output, AggregateBucketOptions<TValue> options = null, ExpressionTranslationOptions translationOptions = null)
Parameters
groupByExpression<Func<TInput, TValue>>The group by expression.
boundariesIEnumerable<TValue>The boundaries.
outputExpression<Func<IGrouping<TValue, TInput>, TOutput>>The output projection.
optionsAggregateBucketOptions<TValue>The options.
translationOptionsExpressionTranslationOptionsThe translation options.
Returns
- PipelineStageDefinition<TInput, TOutput>
The stage.
Type Parameters
TInputThe type of the input documents.
TValueThe type of the values.
TOutputThe type of the output documents.
ChangeStream<TInput>(ChangeStreamStageOptions)
Creates a $changeStream stage. Normally you would prefer to use the Watch method of IMongoCollection<TDocument>. Only use this method if subsequent stages project away the resume token (the _id) or you don't want the resulting cursor to automatically resume.
public static PipelineStageDefinition<TInput, ChangeStreamDocument<TInput>> ChangeStream<TInput>(ChangeStreamStageOptions options = null)
Parameters
optionsChangeStreamStageOptionsThe options.
Returns
- PipelineStageDefinition<TInput, ChangeStreamDocument<TInput>>
The stage.
Type Parameters
TInputThe type of the input documents.
Count<TInput>()
Creates a $count stage.
public static PipelineStageDefinition<TInput, AggregateCountResult> Count<TInput>()
Returns
- PipelineStageDefinition<TInput, AggregateCountResult>
The stage.
Type Parameters
TInputThe type of the input documents.
Densify<TInput>(FieldDefinition<TInput>, DensifyRange, params FieldDefinition<TInput>[])
Creates a $densify stage.
public static PipelineStageDefinition<TInput, TInput> Densify<TInput>(FieldDefinition<TInput> field, DensifyRange range, params FieldDefinition<TInput>[] partitionByFields)
Parameters
fieldFieldDefinition<TInput>The field.
rangeDensifyRangeThe range.
partitionByFieldsFieldDefinition<TInput>[]The partition by fields.
Returns
- PipelineStageDefinition<TInput, TInput>
The stage.
Type Parameters
TInputThe type of the input documents.
Densify<TInput>(FieldDefinition<TInput>, DensifyRange, IEnumerable<FieldDefinition<TInput>>)
Creates a $densify stage.
public static PipelineStageDefinition<TInput, TInput> Densify<TInput>(FieldDefinition<TInput> field, DensifyRange range, IEnumerable<FieldDefinition<TInput>> partitionByFields = null)
Parameters
fieldFieldDefinition<TInput>The field.
rangeDensifyRangeThe range.
partitionByFieldsIEnumerable<FieldDefinition<TInput>>The partition by fields.
Returns
- PipelineStageDefinition<TInput, TInput>
The stage.
Type Parameters
TInputThe type of the input documents.
Densify<TInput>(Expression<Func<TInput, object>>, DensifyRange, IEnumerable<Expression<Func<TInput, object>>>)
Creates a $densify stage.
public static PipelineStageDefinition<TInput, TInput> Densify<TInput>(Expression<Func<TInput, object>> field, DensifyRange range, IEnumerable<Expression<Func<TInput, object>>> partitionByFields = null)
Parameters
fieldExpression<Func<TInput, object>>The field.
rangeDensifyRangeThe range.
partitionByFieldsIEnumerable<Expression<Func<TInput, object>>>The partition by fields.
Returns
- PipelineStageDefinition<TInput, TInput>
The stage.
Type Parameters
TInputThe type of the input documents.
Densify<TInput>(Expression<Func<TInput, object>>, DensifyRange, params Expression<Func<TInput, object>>[])
Creates a $densify stage.
public static PipelineStageDefinition<TInput, TInput> Densify<TInput>(Expression<Func<TInput, object>> field, DensifyRange range, params Expression<Func<TInput, object>>[] partitionByFields)
Parameters
fieldExpression<Func<TInput, object>>The field.
rangeDensifyRangeThe range.
partitionByFieldsExpression<Func<TInput, object>>[]The partition by fields.
Returns
- PipelineStageDefinition<TInput, TInput>
The stage.
Type Parameters
TInputThe type of the input documents.
Documents<TDocument>(AggregateExpressionDefinition<NoPipelineInput, IEnumerable<TDocument>>, IBsonSerializer<TDocument>)
Creates a $documents stage.
public static PipelineStageDefinition<NoPipelineInput, TDocument> Documents<TDocument>(AggregateExpressionDefinition<NoPipelineInput, IEnumerable<TDocument>> documents, IBsonSerializer<TDocument> documentSerializer = null)
Parameters
documentsAggregateExpressionDefinition<NoPipelineInput, IEnumerable<TDocument>>The documents.
documentSerializerIBsonSerializer<TDocument>The document serializer.
Returns
- PipelineStageDefinition<NoPipelineInput, TDocument>
The stage.
Type Parameters
TDocumentThe type of the documents.
Documents<TDocument>(IEnumerable<TDocument>, IBsonSerializer<TDocument>)
Creates a $documents stage.
public static PipelineStageDefinition<NoPipelineInput, TDocument> Documents<TDocument>(IEnumerable<TDocument> documents, IBsonSerializer<TDocument> documentSerializer = null)
Parameters
documentsIEnumerable<TDocument>The documents.
documentSerializerIBsonSerializer<TDocument>The document serializer.
Returns
- PipelineStageDefinition<NoPipelineInput, TDocument>
The stage.
Type Parameters
TDocumentThe type of the documents.
Facet<TInput>(params AggregateFacet<TInput>[])
Creates a $facet stage.
public static PipelineStageDefinition<TInput, AggregateFacetResults> Facet<TInput>(params AggregateFacet<TInput>[] facets)
Parameters
facetsAggregateFacet<TInput>[]The facets.
Returns
- PipelineStageDefinition<TInput, AggregateFacetResults>
The stage.
Type Parameters
TInputThe type of the input documents.
Facet<TInput>(IEnumerable<AggregateFacet<TInput>>)
Creates a $facet stage.
public static PipelineStageDefinition<TInput, AggregateFacetResults> Facet<TInput>(IEnumerable<AggregateFacet<TInput>> facets)
Parameters
facetsIEnumerable<AggregateFacet<TInput>>The facets.
Returns
- PipelineStageDefinition<TInput, AggregateFacetResults>
The stage.
Type Parameters
TInputThe type of the input documents.
Facet<TInput, TOutput>(params AggregateFacet<TInput>[])
Creates a $facet stage.
public static PipelineStageDefinition<TInput, TOutput> Facet<TInput, TOutput>(params AggregateFacet<TInput>[] facets)
Parameters
facetsAggregateFacet<TInput>[]The facets.
Returns
- PipelineStageDefinition<TInput, TOutput>
The stage.
Type Parameters
TInputThe type of the input documents.
TOutputThe type of the output documents.
Facet<TInput, TOutput>(IEnumerable<AggregateFacet<TInput>>, AggregateFacetOptions<TOutput>)
Creates a $facet stage.
public static PipelineStageDefinition<TInput, TOutput> Facet<TInput, TOutput>(IEnumerable<AggregateFacet<TInput>> facets, AggregateFacetOptions<TOutput> options = null)
Parameters
facetsIEnumerable<AggregateFacet<TInput>>The facets.
optionsAggregateFacetOptions<TOutput>The options.
Returns
- PipelineStageDefinition<TInput, TOutput>
The stage.
Type Parameters
TInputThe type of the input documents.
TOutputThe type of the output documents.
GraphLookup<TInput, TFrom>(IMongoCollection<TFrom>, FieldDefinition<TFrom, BsonValue>, FieldDefinition<TFrom, BsonValue>, AggregateExpressionDefinition<TInput, BsonValue>, FieldDefinition<BsonDocument, IEnumerable<BsonDocument>>, FieldDefinition<BsonDocument, int>)
Creates a $graphLookup stage.
public static PipelineStageDefinition<TInput, BsonDocument> GraphLookup<TInput, TFrom>(IMongoCollection<TFrom> from, FieldDefinition<TFrom, BsonValue> connectFromField, FieldDefinition<TFrom, BsonValue> connectToField, AggregateExpressionDefinition<TInput, BsonValue> startWith, FieldDefinition<BsonDocument, IEnumerable<BsonDocument>> @as, FieldDefinition<BsonDocument, int> depthField = null)
Parameters
fromIMongoCollection<TFrom>The from collection.
connectFromFieldFieldDefinition<TFrom, BsonValue>The connect from field.
connectToFieldFieldDefinition<TFrom, BsonValue>The connect to field.
startWithAggregateExpressionDefinition<TInput, BsonValue>The start with value.
asFieldDefinition<BsonDocument, IEnumerable<BsonDocument>>The as field.
depthFieldFieldDefinition<BsonDocument, int>The depth field.
Returns
- PipelineStageDefinition<TInput, BsonDocument>
The fluent aggregate interface.
Type Parameters
TInputThe type of the input documents.
TFromThe type of the from documents.
GraphLookup<TInput, TFrom, TConnectFrom, TConnectTo, TStartWith, TAs, TOutput>(IMongoCollection<TFrom>, FieldDefinition<TFrom, TConnectFrom>, FieldDefinition<TFrom, TConnectTo>, AggregateExpressionDefinition<TInput, TStartWith>, FieldDefinition<TOutput, TAs>, AggregateGraphLookupOptions<TFrom, TFrom, TOutput>)
Creates a $graphLookup stage.
public static PipelineStageDefinition<TInput, TOutput> GraphLookup<TInput, TFrom, TConnectFrom, TConnectTo, TStartWith, TAs, TOutput>(IMongoCollection<TFrom> from, FieldDefinition<TFrom, TConnectFrom> connectFromField, FieldDefinition<TFrom, TConnectTo> connectToField, AggregateExpressionDefinition<TInput, TStartWith> startWith, FieldDefinition<TOutput, TAs> @as, AggregateGraphLookupOptions<TFrom, TFrom, TOutput> options = null) where TAs : IEnumerable<TFrom>
Parameters
fromIMongoCollection<TFrom>The from collection.
connectFromFieldFieldDefinition<TFrom, TConnectFrom>The connect from field.
connectToFieldFieldDefinition<TFrom, TConnectTo>The connect to field.
startWithAggregateExpressionDefinition<TInput, TStartWith>The start with value.
asFieldDefinition<TOutput, TAs>The as field.
optionsAggregateGraphLookupOptions<TFrom, TFrom, TOutput>The options.
Returns
- PipelineStageDefinition<TInput, TOutput>
The stage.
Type Parameters
TInputThe type of the input documents.
TFromThe type of the from documents.
TConnectFromThe type of the connect from field (must be either TConnectTo or a type that implements IEnumerable{TConnectTo}).
TConnectToThe type of the connect to field.
TStartWithThe type of the start with expression (must be either TConnectTo or a type that implements IEnumerable{TConnectTo}).
TAsThe type of the as field.
TOutputThe type of the output documents.
GraphLookup<TInput, TFrom, TConnectFrom, TConnectTo, TStartWith, TAs, TOutput>(IMongoCollection<TFrom>, Expression<Func<TFrom, TConnectFrom>>, Expression<Func<TFrom, TConnectTo>>, Expression<Func<TInput, TStartWith>>, Expression<Func<TOutput, TAs>>, AggregateGraphLookupOptions<TFrom, TFrom, TOutput>, ExpressionTranslationOptions)
Creates a $graphLookup stage.
public static PipelineStageDefinition<TInput, TOutput> GraphLookup<TInput, TFrom, TConnectFrom, TConnectTo, TStartWith, TAs, TOutput>(IMongoCollection<TFrom> from, Expression<Func<TFrom, TConnectFrom>> connectFromField, Expression<Func<TFrom, TConnectTo>> connectToField, Expression<Func<TInput, TStartWith>> startWith, Expression<Func<TOutput, TAs>> @as, AggregateGraphLookupOptions<TFrom, TFrom, TOutput> options = null, ExpressionTranslationOptions translationOptions = null) where TAs : IEnumerable<TFrom>
Parameters
fromIMongoCollection<TFrom>The from collection.
connectFromFieldExpression<Func<TFrom, TConnectFrom>>The connect from field.
connectToFieldExpression<Func<TFrom, TConnectTo>>The connect to field.
startWithExpression<Func<TInput, TStartWith>>The start with value.
asExpression<Func<TOutput, TAs>>The as field.
optionsAggregateGraphLookupOptions<TFrom, TFrom, TOutput>The options.
translationOptionsExpressionTranslationOptionsThe translation options.
Returns
- PipelineStageDefinition<TInput, TOutput>
The stage.
Type Parameters
TInputThe type of the input documents.
TFromThe type of the from documents.
TConnectFromThe type of the connect from field (must be either TConnectTo or a type that implements IEnumerable{TConnectTo}).
TConnectToThe type of the connect to field.
TStartWithThe type of the start with expression (must be either TConnectTo or a type that implements IEnumerable{TConnectTo}).
TAsThe type of the as field.
TOutputThe type of the output documents.
GraphLookup<TInput, TFrom, TConnectFrom, TConnectTo, TStartWith, TAsElement, TAs, TOutput>(IMongoCollection<TFrom>, FieldDefinition<TFrom, TConnectFrom>, FieldDefinition<TFrom, TConnectTo>, AggregateExpressionDefinition<TInput, TStartWith>, FieldDefinition<TOutput, TAs>, FieldDefinition<TAsElement, int>, AggregateGraphLookupOptions<TFrom, TAsElement, TOutput>)
Creates a $graphLookup stage.
public static PipelineStageDefinition<TInput, TOutput> GraphLookup<TInput, TFrom, TConnectFrom, TConnectTo, TStartWith, TAsElement, TAs, TOutput>(IMongoCollection<TFrom> from, FieldDefinition<TFrom, TConnectFrom> connectFromField, FieldDefinition<TFrom, TConnectTo> connectToField, AggregateExpressionDefinition<TInput, TStartWith> startWith, FieldDefinition<TOutput, TAs> @as, FieldDefinition<TAsElement, int> depthField, AggregateGraphLookupOptions<TFrom, TAsElement, TOutput> options = null) where TAs : IEnumerable<TAsElement>
Parameters
fromIMongoCollection<TFrom>The from collection.
connectFromFieldFieldDefinition<TFrom, TConnectFrom>The connect from field.
connectToFieldFieldDefinition<TFrom, TConnectTo>The connect to field.
startWithAggregateExpressionDefinition<TInput, TStartWith>The start with value.
asFieldDefinition<TOutput, TAs>The as field.
depthFieldFieldDefinition<TAsElement, int>The depth field.
optionsAggregateGraphLookupOptions<TFrom, TAsElement, TOutput>The options.
Returns
- PipelineStageDefinition<TInput, TOutput>
The stage.
Type Parameters
TInputThe type of the input documents.
TFromThe type of the from documents.
TConnectFromThe type of the connect from field (must be either TConnectTo or a type that implements IEnumerable{TConnectTo}).
TConnectToThe type of the connect to field.
TStartWithThe type of the start with expression (must be either TConnectTo or a type that implements IEnumerable{TConnectTo}).
TAsElementThe type of the as field elements.
TAsThe type of the as field.
TOutputThe type of the output documents.
GraphLookup<TInput, TFrom, TConnectFrom, TConnectTo, TStartWith, TAsElement, TAs, TOutput>(IMongoCollection<TFrom>, Expression<Func<TFrom, TConnectFrom>>, Expression<Func<TFrom, TConnectTo>>, Expression<Func<TInput, TStartWith>>, Expression<Func<TOutput, TAs>>, Expression<Func<TAsElement, int>>, AggregateGraphLookupOptions<TFrom, TAsElement, TOutput>, ExpressionTranslationOptions)
Creates a $graphLookup stage.
public static PipelineStageDefinition<TInput, TOutput> GraphLookup<TInput, TFrom, TConnectFrom, TConnectTo, TStartWith, TAsElement, TAs, TOutput>(IMongoCollection<TFrom> from, Expression<Func<TFrom, TConnectFrom>> connectFromField, Expression<Func<TFrom, TConnectTo>> connectToField, Expression<Func<TInput, TStartWith>> startWith, Expression<Func<TOutput, TAs>> @as, Expression<Func<TAsElement, int>> depthField, AggregateGraphLookupOptions<TFrom, TAsElement, TOutput> options = null, ExpressionTranslationOptions translationOptions = null) where TAs : IEnumerable<TAsElement>
Parameters
fromIMongoCollection<TFrom>The from collection.
connectFromFieldExpression<Func<TFrom, TConnectFrom>>The connect from field.
connectToFieldExpression<Func<TFrom, TConnectTo>>The connect to field.
startWithExpression<Func<TInput, TStartWith>>The start with value.
asExpression<Func<TOutput, TAs>>The as field.
depthFieldExpression<Func<TAsElement, int>>The depth field.
optionsAggregateGraphLookupOptions<TFrom, TAsElement, TOutput>The options.
translationOptionsExpressionTranslationOptionsThe translation options.
Returns
- PipelineStageDefinition<TInput, TOutput>
The stage.
Type Parameters
TInputThe type of the input documents.
TFromThe type of the from documents.
TConnectFromThe type of the connect from field (must be either TConnectTo or a type that implements IEnumerable{TConnectTo}).
TConnectToThe type of the connect to field.
TStartWithThe type of the start with expression (must be either TConnectTo or a type that implements IEnumerable{TConnectTo}).
TAsElementThe type of the as field elements.
TAsThe type of the as field.
TOutputThe type of the output documents.
Group<TInput>(ProjectionDefinition<TInput, BsonDocument>)
Creates a $group stage.
public static PipelineStageDefinition<TInput, BsonDocument> Group<TInput>(ProjectionDefinition<TInput, BsonDocument> group)
Parameters
groupProjectionDefinition<TInput, BsonDocument>The group projection.
Returns
- PipelineStageDefinition<TInput, BsonDocument>
The stage.
Type Parameters
TInputThe type of the input documents.
Group<TInput, TOutput>(ProjectionDefinition<TInput, TOutput>)
Creates a $group stage.
public static PipelineStageDefinition<TInput, TOutput> Group<TInput, TOutput>(ProjectionDefinition<TInput, TOutput> group)
Parameters
groupProjectionDefinition<TInput, TOutput>The group projection.
Returns
- PipelineStageDefinition<TInput, TOutput>
The stage.
Type Parameters
TInputThe type of the input documents.
TOutputThe type of the output documents.
Group<TInput, TValue, TOutput>(Expression<Func<TInput, TValue>>, Expression<Func<IGrouping<TValue, TInput>, TOutput>>, ExpressionTranslationOptions)
Creates a $group stage (this method can only be used with LINQ2).
public static PipelineStageDefinition<TInput, TOutput> Group<TInput, TValue, TOutput>(Expression<Func<TInput, TValue>> value, Expression<Func<IGrouping<TValue, TInput>, TOutput>> group, ExpressionTranslationOptions translationOptions = null)
Parameters
valueExpression<Func<TInput, TValue>>The value field.
groupExpression<Func<IGrouping<TValue, TInput>, TOutput>>The group projection.
translationOptionsExpressionTranslationOptionsThe translation options.
Returns
- PipelineStageDefinition<TInput, TOutput>
The stage.
Type Parameters
TInputThe type of the input documents.
TValueThe type of the values.
TOutputThe type of the output documents.
Remarks
This method can only be used with LINQ2 but that can't be verified until Render is called.
Limit<TInput>(long)
Creates a $limit stage.
public static PipelineStageDefinition<TInput, TInput> Limit<TInput>(long limit)
Parameters
limitlongThe limit.
Returns
- PipelineStageDefinition<TInput, TInput>
The stage.
Type Parameters
TInputThe type of the input documents.
Lookup<TInput, TForeignDocument, TOutput>(IMongoCollection<TForeignDocument>, FieldDefinition<TInput>, FieldDefinition<TForeignDocument>, FieldDefinition<TOutput>, AggregateLookupOptions<TForeignDocument, TOutput>)
Creates a $lookup stage.
public static PipelineStageDefinition<TInput, TOutput> Lookup<TInput, TForeignDocument, TOutput>(IMongoCollection<TForeignDocument> foreignCollection, FieldDefinition<TInput> localField, FieldDefinition<TForeignDocument> foreignField, FieldDefinition<TOutput> @as, AggregateLookupOptions<TForeignDocument, TOutput> options = null)
Parameters
foreignCollectionIMongoCollection<TForeignDocument>The foreign collection.
localFieldFieldDefinition<TInput>The local field.
foreignFieldFieldDefinition<TForeignDocument>The foreign field.
asFieldDefinition<TOutput>The "as" field.
optionsAggregateLookupOptions<TForeignDocument, TOutput>The options.
Returns
- PipelineStageDefinition<TInput, TOutput>
The stage.
Type Parameters
TInputThe type of the input documents.
TForeignDocumentThe type of the foreign collection documents.
TOutputThe type of the output documents.
Lookup<TInput, TForeignDocument, TOutput>(IMongoCollection<TForeignDocument>, Expression<Func<TInput, object>>, Expression<Func<TForeignDocument, object>>, Expression<Func<TOutput, object>>, AggregateLookupOptions<TForeignDocument, TOutput>)
Creates a $lookup stage.
public static PipelineStageDefinition<TInput, TOutput> Lookup<TInput, TForeignDocument, TOutput>(IMongoCollection<TForeignDocument> foreignCollection, Expression<Func<TInput, object>> localField, Expression<Func<TForeignDocument, object>> foreignField, Expression<Func<TOutput, object>> @as, AggregateLookupOptions<TForeignDocument, TOutput> options = null)
Parameters
foreignCollectionIMongoCollection<TForeignDocument>The foreign collection.
localFieldExpression<Func<TInput, object>>The local field.
foreignFieldExpression<Func<TForeignDocument, object>>The foreign field.
asExpression<Func<TOutput, object>>The "as" field.
optionsAggregateLookupOptions<TForeignDocument, TOutput>The options.
Returns
- PipelineStageDefinition<TInput, TOutput>
The stage.
Type Parameters
TInputThe type of the input documents.
TForeignDocumentThe type of the foreign collection documents.
TOutputThe type of the output documents.
Lookup<TInput, TForeignDocument, TAsElement, TAs, TOutput>(IMongoCollection<TForeignDocument>, BsonDocument, PipelineDefinition<TForeignDocument, TAsElement>, FieldDefinition<TOutput, TAs>, AggregateLookupOptions<TForeignDocument, TOutput>)
Creates a $lookup stage.
public static PipelineStageDefinition<TInput, TOutput> Lookup<TInput, TForeignDocument, TAsElement, TAs, TOutput>(IMongoCollection<TForeignDocument> foreignCollection, BsonDocument let, PipelineDefinition<TForeignDocument, TAsElement> lookupPipeline, FieldDefinition<TOutput, TAs> @as, AggregateLookupOptions<TForeignDocument, TOutput> options = null) where TAs : IEnumerable<TAsElement>
Parameters
foreignCollectionIMongoCollection<TForeignDocument>The foreign collection.
letBsonDocumentThe "let" definition.
lookupPipelinePipelineDefinition<TForeignDocument, TAsElement>The lookup pipeline.
asFieldDefinition<TOutput, TAs>The as field in
TOutputin which to place the results of the lookup pipeline.optionsAggregateLookupOptions<TForeignDocument, TOutput>The options.
Returns
- PipelineStageDefinition<TInput, TOutput>
The stage.
Type Parameters
TInputThe type of the input documents.
TForeignDocumentThe type of the foreign collection documents.
TAsElementThe type of the as field elements.
TAsThe type of the as field.
TOutputThe type of the output documents.
Lookup<TInput, TForeignDocument, TAsElement, TAs, TOutput>(IMongoCollection<TForeignDocument>, BsonDocument, PipelineDefinition<TForeignDocument, TAsElement>, Expression<Func<TOutput, TAs>>, AggregateLookupOptions<TForeignDocument, TOutput>)
Creates a $lookup stage.
public static PipelineStageDefinition<TInput, TOutput> Lookup<TInput, TForeignDocument, TAsElement, TAs, TOutput>(IMongoCollection<TForeignDocument> foreignCollection, BsonDocument let, PipelineDefinition<TForeignDocument, TAsElement> lookupPipeline, Expression<Func<TOutput, TAs>> @as, AggregateLookupOptions<TForeignDocument, TOutput> options = null) where TAs : IEnumerable<TAsElement>
Parameters
foreignCollectionIMongoCollection<TForeignDocument>The foreign collection.
letBsonDocumentThe "let" definition.
lookupPipelinePipelineDefinition<TForeignDocument, TAsElement>The lookup pipeline.
asExpression<Func<TOutput, TAs>>The as field in
TOutputin which to place the results of the lookup pipeline.optionsAggregateLookupOptions<TForeignDocument, TOutput>The options.
Returns
- PipelineStageDefinition<TInput, TOutput>
The stage.
Type Parameters
TInputThe type of the input documents.
TForeignDocumentThe type of the foreign collection documents.
TAsElementThe type of the as field elements.
TAsThe type of the as field.
TOutputThe type of the output documents.
Match<TInput>(FilterDefinition<TInput>)
Creates a $match stage.
public static PipelineStageDefinition<TInput, TInput> Match<TInput>(FilterDefinition<TInput> filter)
Parameters
filterFilterDefinition<TInput>The filter.
Returns
- PipelineStageDefinition<TInput, TInput>
The stage.
Type Parameters
TInputThe type of the input documents.
Match<TInput>(Expression<Func<TInput, bool>>)
Creates a $match stage.
public static PipelineStageDefinition<TInput, TInput> Match<TInput>(Expression<Func<TInput, bool>> filter)
Parameters
filterExpression<Func<TInput, bool>>The filter.
Returns
- PipelineStageDefinition<TInput, TInput>
The stage.
Type Parameters
TInputThe type of the input documents.
Merge<TInput, TOutput>(IMongoCollection<TOutput>, MergeStageOptions<TOutput>)
Creates a $merge stage.
public static PipelineStageDefinition<TInput, TOutput> Merge<TInput, TOutput>(IMongoCollection<TOutput> outputCollection, MergeStageOptions<TOutput> mergeOptions)
Parameters
outputCollectionIMongoCollection<TOutput>The output collection.
mergeOptionsMergeStageOptions<TOutput>The merge options.
Returns
- PipelineStageDefinition<TInput, TOutput>
The stage.
Type Parameters
TInputThe type of the input documents.
TOutputThe type of the output documents.
OfType<TInput, TOutput>(IBsonSerializer<TOutput>)
Create a $match stage that select documents of a sub type.
public static PipelineStageDefinition<TInput, TOutput> OfType<TInput, TOutput>(IBsonSerializer<TOutput> outputSerializer = null) where TOutput : TInput
Parameters
outputSerializerIBsonSerializer<TOutput>The output serializer.
Returns
- PipelineStageDefinition<TInput, TOutput>
The stage.
Type Parameters
TInputThe type of the input documents.
TOutputThe type of the output documents.
Out<TInput>(IMongoCollection<TInput>)
Creates a $out stage.
public static PipelineStageDefinition<TInput, TInput> Out<TInput>(IMongoCollection<TInput> outputCollection)
Parameters
outputCollectionIMongoCollection<TInput>The output collection.
Returns
- PipelineStageDefinition<TInput, TInput>
The stage.
Type Parameters
TInputThe type of the input documents.
Project<TInput>(ProjectionDefinition<TInput, BsonDocument>)
Creates a $project stage.
public static PipelineStageDefinition<TInput, BsonDocument> Project<TInput>(ProjectionDefinition<TInput, BsonDocument> projection)
Parameters
projectionProjectionDefinition<TInput, BsonDocument>The projection.
Returns
- PipelineStageDefinition<TInput, BsonDocument>
The stage.
Type Parameters
TInputThe type of the input documents.
Project<TInput, TOutput>(ProjectionDefinition<TInput, TOutput>)
Creates a $project stage.
public static PipelineStageDefinition<TInput, TOutput> Project<TInput, TOutput>(ProjectionDefinition<TInput, TOutput> projection)
Parameters
projectionProjectionDefinition<TInput, TOutput>The projection.
Returns
- PipelineStageDefinition<TInput, TOutput>
The stage.
Type Parameters
TInputThe type of the input documents.
TOutputThe type of the output documents.
Project<TInput, TOutput>(Expression<Func<TInput, TOutput>>, ExpressionTranslationOptions)
Creates a $project stage.
public static PipelineStageDefinition<TInput, TOutput> Project<TInput, TOutput>(Expression<Func<TInput, TOutput>> projection, ExpressionTranslationOptions translationOptions = null)
Parameters
projectionExpression<Func<TInput, TOutput>>The projection.
translationOptionsExpressionTranslationOptionsThe translation options.
Returns
- PipelineStageDefinition<TInput, TOutput>
The stage.
Type Parameters
TInputThe type of the input documents.
TOutputThe type of the output documents.
ReplaceRoot<TInput, TOutput>(AggregateExpressionDefinition<TInput, TOutput>)
Creates a $replaceRoot stage.
public static PipelineStageDefinition<TInput, TOutput> ReplaceRoot<TInput, TOutput>(AggregateExpressionDefinition<TInput, TOutput> newRoot)
Parameters
newRootAggregateExpressionDefinition<TInput, TOutput>The new root.
Returns
- PipelineStageDefinition<TInput, TOutput>
The stage.
Type Parameters
TInputThe type of the input documents.
TOutputThe type of the output documents.
ReplaceRoot<TInput, TOutput>(Expression<Func<TInput, TOutput>>, ExpressionTranslationOptions)
Creates a $replaceRoot stage.
public static PipelineStageDefinition<TInput, TOutput> ReplaceRoot<TInput, TOutput>(Expression<Func<TInput, TOutput>> newRoot, ExpressionTranslationOptions translationOptions = null)
Parameters
newRootExpression<Func<TInput, TOutput>>The new root.
translationOptionsExpressionTranslationOptionsThe translation options.
Returns
- PipelineStageDefinition<TInput, TOutput>
The stage.
Type Parameters
TInputThe type of the input documents.
TOutputThe type of the output documents.
ReplaceWith<TInput, TOutput>(AggregateExpressionDefinition<TInput, TOutput>)
Creates a $replaceWith stage.
public static PipelineStageDefinition<TInput, TOutput> ReplaceWith<TInput, TOutput>(AggregateExpressionDefinition<TInput, TOutput> newRoot)
Parameters
newRootAggregateExpressionDefinition<TInput, TOutput>The new root.
Returns
- PipelineStageDefinition<TInput, TOutput>
The stage.
Type Parameters
TInputThe type of the input documents.
TOutputThe type of the output documents.
ReplaceWith<TInput, TOutput>(Expression<Func<TInput, TOutput>>, ExpressionTranslationOptions)
Creates a $replaceWith stage.
public static PipelineStageDefinition<TInput, TOutput> ReplaceWith<TInput, TOutput>(Expression<Func<TInput, TOutput>> newRoot, ExpressionTranslationOptions translationOptions = null)
Parameters
newRootExpression<Func<TInput, TOutput>>The new root.
translationOptionsExpressionTranslationOptionsThe translation options.
Returns
- PipelineStageDefinition<TInput, TOutput>
The stage.
Type Parameters
TInputThe type of the input documents.
TOutputThe type of the output documents.
SearchMeta<TInput>(SearchDefinition<TInput>, string, SearchCountOptions)
Creates a $searchMeta stage.
public static PipelineStageDefinition<TInput, SearchMetaResult> SearchMeta<TInput>(SearchDefinition<TInput> searchDefinition, string indexName = null, SearchCountOptions count = null)
Parameters
searchDefinitionSearchDefinition<TInput>The search definition.
indexNamestringThe index name.
countSearchCountOptionsThe count options.
Returns
- PipelineStageDefinition<TInput, SearchMetaResult>
The stage.
Type Parameters
TInputThe type of the input documents.
Search<TInput>(SearchDefinition<TInput>, SearchHighlightOptions<TInput>, string, SearchCountOptions, bool, bool)
Creates a $search stage.
public static PipelineStageDefinition<TInput, TInput> Search<TInput>(SearchDefinition<TInput> searchDefinition, SearchHighlightOptions<TInput> highlight = null, string indexName = null, SearchCountOptions count = null, bool returnStoredSource = false, bool scoreDetails = false)
Parameters
searchDefinitionSearchDefinition<TInput>The search definition.
highlightSearchHighlightOptions<TInput>The highlight options.
indexNamestringThe index name.
countSearchCountOptionsThe count options.
returnStoredSourceboolFlag that specifies whether to perform a full document lookup on the backend database or return only stored source fields directly from Atlas Search.
scoreDetailsboolFlag that specifies whether to return a detailed breakdown of the score for each document in the result.
Returns
- PipelineStageDefinition<TInput, TInput>
The stage.
Type Parameters
TInputThe type of the input documents.
Search<TInput>(SearchDefinition<TInput>, SearchOptions<TInput>)
Creates a $search stage.
public static PipelineStageDefinition<TInput, TInput> Search<TInput>(SearchDefinition<TInput> searchDefinition, SearchOptions<TInput> searchOptions)
Parameters
searchDefinitionSearchDefinition<TInput>The search definition.
searchOptionsSearchOptions<TInput>The search options.
Returns
- PipelineStageDefinition<TInput, TInput>
The stage.
Type Parameters
TInputThe type of the input documents.
SetWindowFields<TInput, TWindowFields>(AggregateExpressionDefinition<ISetWindowFieldsPartition<TInput>, TWindowFields>)
Create a $setWindowFields stage.
public static PipelineStageDefinition<TInput, BsonDocument> SetWindowFields<TInput, TWindowFields>(AggregateExpressionDefinition<ISetWindowFieldsPartition<TInput>, TWindowFields> output)
Parameters
outputAggregateExpressionDefinition<ISetWindowFieldsPartition<TInput>, TWindowFields>The window fields expression.
Returns
- PipelineStageDefinition<TInput, BsonDocument>
The stage.
Type Parameters
TInputThe type of the input documents.
TWindowFieldsThe type of the added window fields.
SetWindowFields<TInput, TWindowFields>(Expression<Func<ISetWindowFieldsPartition<TInput>, TWindowFields>>, ExpressionTranslationOptions)
Create a $setWindowFields stage.
public static PipelineStageDefinition<TInput, BsonDocument> SetWindowFields<TInput, TWindowFields>(Expression<Func<ISetWindowFieldsPartition<TInput>, TWindowFields>> output, ExpressionTranslationOptions translationOptions = null)
Parameters
outputExpression<Func<ISetWindowFieldsPartition<TInput>, TWindowFields>>The window fields expression.
translationOptionsExpressionTranslationOptionsThe translation options.
Returns
- PipelineStageDefinition<TInput, BsonDocument>
The stage.
Type Parameters
TInputThe type of the input documents.
TWindowFieldsThe type of the added window fields.
SetWindowFields<TInput, TPartitionBy, TWindowFields>(AggregateExpressionDefinition<TInput, TPartitionBy>, AggregateExpressionDefinition<ISetWindowFieldsPartition<TInput>, TWindowFields>)
Create a $setWindowFields stage.
public static PipelineStageDefinition<TInput, BsonDocument> SetWindowFields<TInput, TPartitionBy, TWindowFields>(AggregateExpressionDefinition<TInput, TPartitionBy> partitionBy, AggregateExpressionDefinition<ISetWindowFieldsPartition<TInput>, TWindowFields> output)
Parameters
partitionByAggregateExpressionDefinition<TInput, TPartitionBy>The partitionBy expression.
outputAggregateExpressionDefinition<ISetWindowFieldsPartition<TInput>, TWindowFields>The window fields expression.
Returns
- PipelineStageDefinition<TInput, BsonDocument>
The stage.
Type Parameters
TInputThe type of the input documents.
TPartitionByThe type of the value to partition by.
TWindowFieldsThe type of the added window fields.
SetWindowFields<TInput, TPartitionBy, TWindowFields>(AggregateExpressionDefinition<TInput, TPartitionBy>, SortDefinition<TInput>, AggregateExpressionDefinition<ISetWindowFieldsPartition<TInput>, TWindowFields>)
Create a $setWindowFields stage.
public static PipelineStageDefinition<TInput, BsonDocument> SetWindowFields<TInput, TPartitionBy, TWindowFields>(AggregateExpressionDefinition<TInput, TPartitionBy> partitionBy, SortDefinition<TInput> sortBy, AggregateExpressionDefinition<ISetWindowFieldsPartition<TInput>, TWindowFields> output)
Parameters
partitionByAggregateExpressionDefinition<TInput, TPartitionBy>The partitionBy expression.
sortBySortDefinition<TInput>The sortBy expression.
outputAggregateExpressionDefinition<ISetWindowFieldsPartition<TInput>, TWindowFields>The window fields expression.
Returns
- PipelineStageDefinition<TInput, BsonDocument>
The stage.
Type Parameters
TInputThe type of the input documents.
TPartitionByThe type of the value to partition by.
TWindowFieldsThe type of the added window fields.
SetWindowFields<TInput, TPartitionBy, TWindowFields>(Expression<Func<TInput, TPartitionBy>>, SortDefinition<TInput>, Expression<Func<ISetWindowFieldsPartition<TInput>, TWindowFields>>, ExpressionTranslationOptions)
Create a $setWindowFields stage.
public static PipelineStageDefinition<TInput, BsonDocument> SetWindowFields<TInput, TPartitionBy, TWindowFields>(Expression<Func<TInput, TPartitionBy>> partitionBy, SortDefinition<TInput> sortBy, Expression<Func<ISetWindowFieldsPartition<TInput>, TWindowFields>> output, ExpressionTranslationOptions translationOptions = null)
Parameters
partitionByExpression<Func<TInput, TPartitionBy>>The partitionBy expression.
sortBySortDefinition<TInput>The sortBy expression.
outputExpression<Func<ISetWindowFieldsPartition<TInput>, TWindowFields>>The window fields expression.
translationOptionsExpressionTranslationOptionsThe translation options.
Returns
- PipelineStageDefinition<TInput, BsonDocument>
The stage.
Type Parameters
TInputThe type of the input documents.
TPartitionByThe type of the value to partition by.
TWindowFieldsThe type of the added window fields.
SetWindowFields<TInput, TPartitionBy, TWindowFields>(Expression<Func<TInput, TPartitionBy>>, Expression<Func<ISetWindowFieldsPartition<TInput>, TWindowFields>>, ExpressionTranslationOptions)
Create a $setWindowFields stage.
public static PipelineStageDefinition<TInput, BsonDocument> SetWindowFields<TInput, TPartitionBy, TWindowFields>(Expression<Func<TInput, TPartitionBy>> partitionBy, Expression<Func<ISetWindowFieldsPartition<TInput>, TWindowFields>> output, ExpressionTranslationOptions translationOptions = null)
Parameters
partitionByExpression<Func<TInput, TPartitionBy>>The partitionBy expression.
outputExpression<Func<ISetWindowFieldsPartition<TInput>, TWindowFields>>The window fields expression.
translationOptionsExpressionTranslationOptionsThe translation options.
Returns
- PipelineStageDefinition<TInput, BsonDocument>
The stage.
Type Parameters
TInputThe type of the input documents.
TPartitionByThe type of the value to partition by.
TWindowFieldsThe type of the added window fields.
Set<TInput>(SetFieldDefinitions<TInput>)
Creates a $set stage.
public static PipelineStageDefinition<TInput, TInput> Set<TInput>(SetFieldDefinitions<TInput> fields)
Parameters
fieldsSetFieldDefinitions<TInput>The fields to set.
Returns
- PipelineStageDefinition<TInput, TInput>
The stage.
Type Parameters
TInputThe type of the input documents.
Set<TInput, TFields>(Expression<Func<TInput, TFields>>)
Creates a $set stage.
public static PipelineStageDefinition<TInput, TInput> Set<TInput, TFields>(Expression<Func<TInput, TFields>> fields)
Parameters
fieldsExpression<Func<TInput, TFields>>The fields to set.
Returns
- PipelineStageDefinition<TInput, TInput>
The stage.
Type Parameters
TInputThe type of the input documents.
TFieldsThe type of object specifying the fields to set.
Skip<TInput>(long)
Creates a $skip stage.
public static PipelineStageDefinition<TInput, TInput> Skip<TInput>(long skip)
Parameters
skiplongThe skip.
Returns
- PipelineStageDefinition<TInput, TInput>
The stage.
Type Parameters
TInputThe type of the input documents.
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.
Sort<TInput>(SortDefinition<TInput>)
Creates a $sort stage.
public static PipelineStageDefinition<TInput, TInput> Sort<TInput>(SortDefinition<TInput> sort)
Parameters
sortSortDefinition<TInput>The sort.
Returns
- PipelineStageDefinition<TInput, TInput>
The stage.
Type Parameters
TInputThe type of the input documents.
UnionWith<TInput, TWith>(IMongoCollection<TWith>, PipelineDefinition<TWith, TInput>)
Creates a $unionWith stage.
public static PipelineStageDefinition<TInput, TInput> UnionWith<TInput, TWith>(IMongoCollection<TWith> withCollection, PipelineDefinition<TWith, TInput> withPipeline = null)
Parameters
withCollectionIMongoCollection<TWith>The with collection.
withPipelinePipelineDefinition<TWith, TInput>The with pipeline.
Returns
- PipelineStageDefinition<TInput, TInput>
The stage.
Type Parameters
TInputThe type of the input documents.
TWithThe type of the with collection documents.
Unwind<TInput>(FieldDefinition<TInput>, AggregateUnwindOptions<BsonDocument>)
Creates an $unwind stage.
public static PipelineStageDefinition<TInput, BsonDocument> Unwind<TInput>(FieldDefinition<TInput> field, AggregateUnwindOptions<BsonDocument> options = null)
Parameters
fieldFieldDefinition<TInput>The field to unwind.
optionsAggregateUnwindOptions<BsonDocument>The options.
Returns
- PipelineStageDefinition<TInput, BsonDocument>
The stage.
Type Parameters
TInputThe type of the input documents.
Unwind<TInput>(Expression<Func<TInput, object>>, AggregateUnwindOptions<BsonDocument>)
Creates an $unwind stage.
public static PipelineStageDefinition<TInput, BsonDocument> Unwind<TInput>(Expression<Func<TInput, object>> field, AggregateUnwindOptions<BsonDocument> options = null)
Parameters
fieldExpression<Func<TInput, object>>The field to unwind.
optionsAggregateUnwindOptions<BsonDocument>The options.
Returns
- PipelineStageDefinition<TInput, BsonDocument>
The stage.
Type Parameters
TInputThe type of the input documents.
Unwind<TInput, TOutput>(FieldDefinition<TInput>, AggregateUnwindOptions<TOutput>)
Creates an $unwind stage.
public static PipelineStageDefinition<TInput, TOutput> Unwind<TInput, TOutput>(FieldDefinition<TInput> field, AggregateUnwindOptions<TOutput> options = null)
Parameters
fieldFieldDefinition<TInput>The field.
optionsAggregateUnwindOptions<TOutput>The options.
Returns
- PipelineStageDefinition<TInput, TOutput>
The stage.
Type Parameters
TInputThe type of the input documents.
TOutputThe type of the output documents.
Unwind<TInput, TOutput>(Expression<Func<TInput, object>>, AggregateUnwindOptions<TOutput>)
Creates an $unwind stage.
public static PipelineStageDefinition<TInput, TOutput> Unwind<TInput, TOutput>(Expression<Func<TInput, object>> field, AggregateUnwindOptions<TOutput> options = null)
Parameters
fieldExpression<Func<TInput, object>>The field to unwind.
optionsAggregateUnwindOptions<TOutput>The options.
Returns
- PipelineStageDefinition<TInput, TOutput>
The stage.
Type Parameters
TInputThe type of the input documents.
TOutputThe type of the output documents.
VectorSearch<TInput>(FieldDefinition<TInput>, QueryVector, int, VectorSearchOptions<TInput>)
Creates a $vectorSearch stage.
public static PipelineStageDefinition<TInput, TInput> VectorSearch<TInput>(FieldDefinition<TInput> field, QueryVector queryVector, int limit, VectorSearchOptions<TInput> options = null)
Parameters
fieldFieldDefinition<TInput>The field.
queryVectorQueryVectorThe query vector.
limitintThe limit.
optionsVectorSearchOptions<TInput>The options.
Returns
- PipelineStageDefinition<TInput, TInput>
The stage.
Type Parameters
TInputThe type of the input documents.
VectorSearch<TInput, TField>(Expression<Func<TInput, TField>>, QueryVector, int, VectorSearchOptions<TInput>)
Creates a $vectorSearch stage.
public static PipelineStageDefinition<TInput, TInput> VectorSearch<TInput, TField>(Expression<Func<TInput, TField>> field, QueryVector queryVector, int limit, VectorSearchOptions<TInput> options)
Parameters
fieldExpression<Func<TInput, TField>>The field.
queryVectorQueryVectorThe query vector.
limitintThe limit.
optionsVectorSearchOptions<TInput>The options.
Returns
- PipelineStageDefinition<TInput, TInput>
The stage.
Type Parameters
TInputThe type of the input documents.
TFieldThe type of the field.