Class PipelineDefinitionBuilder
Extension methods for adding stages to a pipeline.
public static class PipelineDefinitionBuilder
- Inheritance
-
PipelineDefinitionBuilder
- Inherited Members
Methods
AppendStage<TInput, TIntermediate, TOutput>(PipelineDefinition<TInput, TIntermediate>, PipelineStageDefinition<TIntermediate, TOutput>, IBsonSerializer<TOutput>)
Appends a stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> AppendStage<TInput, TIntermediate, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, PipelineStageDefinition<TIntermediate, TOutput> stage, IBsonSerializer<TOutput> outputSerializer = null)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
stagePipelineStageDefinition<TIntermediate, TOutput>The stage.
outputSerializerIBsonSerializer<TOutput>The output serializer.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TOutputThe type of the output documents.
As<TInput, TIntermediate, TOutput>(PipelineDefinition<TInput, TIntermediate>, IBsonSerializer<TOutput>)
Changes the output type of the pipeline.
public static PipelineDefinition<TInput, TOutput> As<TInput, TIntermediate, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, IBsonSerializer<TOutput> outputSerializer = null)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
outputSerializerIBsonSerializer<TOutput>The output serializer.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TOutputThe type of the output documents.
BucketAutoForLinq2<TInput, TIntermediate, TValue, TOutput>(PipelineDefinition<TInput, TIntermediate>, Expression<Func<TIntermediate, TValue>>, int, Expression<Func<IGrouping<TValue, TIntermediate>, TOutput>>, AggregateBucketAutoOptions, ExpressionTranslationOptions)
Appends a $bucketAuto stage to the pipeline (this method can only be used with LINQ2).
public static PipelineDefinition<TInput, TOutput> BucketAutoForLinq2<TInput, TIntermediate, TValue, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, Expression<Func<TIntermediate, TValue>> groupBy, int buckets, Expression<Func<IGrouping<TValue, TIntermediate>, TOutput>> output, AggregateBucketAutoOptions options = null, ExpressionTranslationOptions translationOptions = null)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
groupByExpression<Func<TIntermediate, TValue>>The group by expression.
bucketsintThe number of buckets.
outputExpression<Func<IGrouping<TValue, TIntermediate>, TOutput>>The output projection.
optionsAggregateBucketAutoOptionsThe options (optional).
translationOptionsExpressionTranslationOptionsThe translation options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TValueThe type of the value.
TOutputThe type of the output documents.
BucketAuto<TInput, TIntermediate, TValue>(PipelineDefinition<TInput, TIntermediate>, AggregateExpressionDefinition<TIntermediate, TValue>, int, AggregateBucketAutoOptions)
Appends a $bucketAuto stage to the pipeline.
public static PipelineDefinition<TInput, AggregateBucketAutoResult<TValue>> BucketAuto<TInput, TIntermediate, TValue>(this PipelineDefinition<TInput, TIntermediate> pipeline, AggregateExpressionDefinition<TIntermediate, TValue> groupBy, int buckets, AggregateBucketAutoOptions options = null)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
groupByAggregateExpressionDefinition<TIntermediate, TValue>The group by expression.
bucketsintThe number of buckets.
optionsAggregateBucketAutoOptionsThe options.
Returns
- PipelineDefinition<TInput, AggregateBucketAutoResult<TValue>>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TValueThe type of the values.
BucketAuto<TInput, TIntermediate, TValue>(PipelineDefinition<TInput, TIntermediate>, Expression<Func<TIntermediate, TValue>>, int, AggregateBucketAutoOptions, ExpressionTranslationOptions)
Appends a $bucketAuto stage to the pipeline.
public static PipelineDefinition<TInput, AggregateBucketAutoResult<TValue>> BucketAuto<TInput, TIntermediate, TValue>(this PipelineDefinition<TInput, TIntermediate> pipeline, Expression<Func<TIntermediate, TValue>> groupBy, int buckets, AggregateBucketAutoOptions options = null, ExpressionTranslationOptions translationOptions = null)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
groupByExpression<Func<TIntermediate, TValue>>The group by expression.
bucketsintThe number of buckets.
optionsAggregateBucketAutoOptionsThe options (optional).
translationOptionsExpressionTranslationOptionsThe translation options.
Returns
- PipelineDefinition<TInput, AggregateBucketAutoResult<TValue>>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TValueThe type of the value.
BucketAuto<TInput, TIntermediate, TValue, TOutput>(PipelineDefinition<TInput, TIntermediate>, AggregateExpressionDefinition<TIntermediate, TValue>, int, ProjectionDefinition<TIntermediate, TOutput>, AggregateBucketAutoOptions)
Appends a $bucketAuto stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> BucketAuto<TInput, TIntermediate, TValue, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, AggregateExpressionDefinition<TIntermediate, TValue> groupBy, int buckets, ProjectionDefinition<TIntermediate, TOutput> output, AggregateBucketAutoOptions options = null)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
groupByAggregateExpressionDefinition<TIntermediate, TValue>The group by expression.
bucketsintThe number of buckets.
outputProjectionDefinition<TIntermediate, TOutput>The output projection.
optionsAggregateBucketAutoOptionsThe options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TValueThe type of the values.
TOutputThe type of the output documents.
BucketAuto<TInput, TIntermediate, TValue, TOutput>(PipelineDefinition<TInput, TIntermediate>, Expression<Func<TIntermediate, TValue>>, int, Expression<Func<IGrouping<AggregateBucketAutoResultId<TValue>, TIntermediate>, TOutput>>, AggregateBucketAutoOptions, ExpressionTranslationOptions)
Appends a $bucketAuto stage to the pipeline (this overload can only be used with LINQ3).
public static PipelineDefinition<TInput, TOutput> BucketAuto<TInput, TIntermediate, TValue, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, Expression<Func<TIntermediate, TValue>> groupBy, int buckets, Expression<Func<IGrouping<AggregateBucketAutoResultId<TValue>, TIntermediate>, TOutput>> output, AggregateBucketAutoOptions options = null, ExpressionTranslationOptions translationOptions = null)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
groupByExpression<Func<TIntermediate, TValue>>The group by expression.
bucketsintThe number of buckets.
outputExpression<Func<IGrouping<AggregateBucketAutoResultId<TValue>, TIntermediate>, TOutput>>The output projection.
optionsAggregateBucketAutoOptionsThe options (optional).
translationOptionsExpressionTranslationOptionsThe translation options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TValueThe type of the value.
TOutputThe type of the output documents.
Bucket<TInput, TIntermediate, TValue>(PipelineDefinition<TInput, TIntermediate>, AggregateExpressionDefinition<TIntermediate, TValue>, IEnumerable<TValue>, AggregateBucketOptions<TValue>)
Appends a $bucket stage to the pipeline.
public static PipelineDefinition<TInput, AggregateBucketResult<TValue>> Bucket<TInput, TIntermediate, TValue>(this PipelineDefinition<TInput, TIntermediate> pipeline, AggregateExpressionDefinition<TIntermediate, TValue> groupBy, IEnumerable<TValue> boundaries, AggregateBucketOptions<TValue> options = null)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
groupByAggregateExpressionDefinition<TIntermediate, TValue>The group by expression.
boundariesIEnumerable<TValue>The boundaries.
optionsAggregateBucketOptions<TValue>The options.
Returns
- PipelineDefinition<TInput, AggregateBucketResult<TValue>>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TValueThe type of the values.
Bucket<TInput, TIntermediate, TValue>(PipelineDefinition<TInput, TIntermediate>, Expression<Func<TIntermediate, TValue>>, IEnumerable<TValue>, AggregateBucketOptions<TValue>, ExpressionTranslationOptions)
Appends a $bucket stage to the pipeline.
public static PipelineDefinition<TInput, AggregateBucketResult<TValue>> Bucket<TInput, TIntermediate, TValue>(this PipelineDefinition<TInput, TIntermediate> pipeline, Expression<Func<TIntermediate, TValue>> groupBy, IEnumerable<TValue> boundaries, AggregateBucketOptions<TValue> options = null, ExpressionTranslationOptions translationOptions = null)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
groupByExpression<Func<TIntermediate, TValue>>The group by expression.
boundariesIEnumerable<TValue>The boundaries.
optionsAggregateBucketOptions<TValue>The options.
translationOptionsExpressionTranslationOptionsThe translation options.
Returns
- PipelineDefinition<TInput, AggregateBucketResult<TValue>>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TValueThe type of the values.
Bucket<TInput, TIntermediate, TValue, TOutput>(PipelineDefinition<TInput, TIntermediate>, AggregateExpressionDefinition<TIntermediate, TValue>, IEnumerable<TValue>, ProjectionDefinition<TIntermediate, TOutput>, AggregateBucketOptions<TValue>)
Appends a $bucket stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> Bucket<TInput, TIntermediate, TValue, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, AggregateExpressionDefinition<TIntermediate, TValue> groupBy, IEnumerable<TValue> boundaries, ProjectionDefinition<TIntermediate, TOutput> output, AggregateBucketOptions<TValue> options = null)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
groupByAggregateExpressionDefinition<TIntermediate, TValue>The group by expression.
boundariesIEnumerable<TValue>The boundaries.
outputProjectionDefinition<TIntermediate, TOutput>The output projection.
optionsAggregateBucketOptions<TValue>The options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TValueThe type of the values.
TOutputThe type of the output documents.
Bucket<TInput, TIntermediate, TValue, TOutput>(PipelineDefinition<TInput, TIntermediate>, Expression<Func<TIntermediate, TValue>>, IEnumerable<TValue>, Expression<Func<IGrouping<TValue, TIntermediate>, TOutput>>, AggregateBucketOptions<TValue>, ExpressionTranslationOptions)
Appends a $bucket stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> Bucket<TInput, TIntermediate, TValue, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, Expression<Func<TIntermediate, TValue>> groupBy, IEnumerable<TValue> boundaries, Expression<Func<IGrouping<TValue, TIntermediate>, TOutput>> output, AggregateBucketOptions<TValue> options = null, ExpressionTranslationOptions translationOptions = null)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
groupByExpression<Func<TIntermediate, TValue>>The group by expression.
boundariesIEnumerable<TValue>The boundaries.
outputExpression<Func<IGrouping<TValue, TIntermediate>, TOutput>>The output projection.
optionsAggregateBucketOptions<TValue>The options.
translationOptionsExpressionTranslationOptionsThe translation options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TValueThe type of the values.
TOutputThe type of the output documents.
ChangeStream<TInput, TIntermediate>(PipelineDefinition<TInput, TIntermediate>, ChangeStreamStageOptions)
Appends a $changeStream stage to the pipeline. 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 PipelineDefinition<TInput, ChangeStreamDocument<TIntermediate>> ChangeStream<TInput, TIntermediate>(this PipelineDefinition<TInput, TIntermediate> pipeline, ChangeStreamStageOptions options = null)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
optionsChangeStreamStageOptionsThe options.
Returns
- PipelineDefinition<TInput, ChangeStreamDocument<TIntermediate>>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
Count<TInput, TIntermediate>(PipelineDefinition<TInput, TIntermediate>)
Appends a $count stage to the pipeline.
public static PipelineDefinition<TInput, AggregateCountResult> Count<TInput, TIntermediate>(this PipelineDefinition<TInput, TIntermediate> pipeline)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
Returns
- PipelineDefinition<TInput, AggregateCountResult>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
Densify<TInput, TOutput>(PipelineDefinition<TInput, TOutput>, FieldDefinition<TOutput>, DensifyRange, params FieldDefinition<TOutput>[])
Appends a $densify stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> Densify<TInput, TOutput>(this PipelineDefinition<TInput, TOutput> pipeline, FieldDefinition<TOutput> field, DensifyRange range, params FieldDefinition<TOutput>[] partitionByFields)
Parameters
pipelinePipelineDefinition<TInput, TOutput>The pipeline.
fieldFieldDefinition<TOutput>The field.
rangeDensifyRangeThe range.
partitionByFieldsFieldDefinition<TOutput>[]The partition by fields.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TOutputThe type of the output documents.
Densify<TInput, TOutput>(PipelineDefinition<TInput, TOutput>, FieldDefinition<TOutput>, DensifyRange, IEnumerable<FieldDefinition<TOutput>>)
Appends a $densify stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> Densify<TInput, TOutput>(this PipelineDefinition<TInput, TOutput> pipeline, FieldDefinition<TOutput> field, DensifyRange range, IEnumerable<FieldDefinition<TOutput>> partitionByFields = null)
Parameters
pipelinePipelineDefinition<TInput, TOutput>The pipeline.
fieldFieldDefinition<TOutput>The field.
rangeDensifyRangeThe range.
partitionByFieldsIEnumerable<FieldDefinition<TOutput>>The partition by fields.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TOutputThe type of the output documents.
Densify<TInput, TOutput>(PipelineDefinition<TInput, TOutput>, Expression<Func<TOutput, object>>, DensifyRange, IEnumerable<Expression<Func<TOutput, object>>>)
Appends a $densify stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> Densify<TInput, TOutput>(this PipelineDefinition<TInput, TOutput> pipeline, Expression<Func<TOutput, object>> field, DensifyRange range, IEnumerable<Expression<Func<TOutput, object>>> partitionByFields = null)
Parameters
pipelinePipelineDefinition<TInput, TOutput>The pipeline.
fieldExpression<Func<TOutput, object>>The field.
rangeDensifyRangeThe range.
partitionByFieldsIEnumerable<Expression<Func<TOutput, object>>>The partition by fields.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TOutputThe type of the output documents.
Densify<TInput, TOutput>(PipelineDefinition<TInput, TOutput>, Expression<Func<TOutput, object>>, DensifyRange, params Expression<Func<TOutput, object>>[])
Appends a $densify stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> Densify<TInput, TOutput>(this PipelineDefinition<TInput, TOutput> pipeline, Expression<Func<TOutput, object>> field, DensifyRange range, params Expression<Func<TOutput, object>>[] partitionByFields)
Parameters
pipelinePipelineDefinition<TInput, TOutput>The pipeline.
fieldExpression<Func<TOutput, object>>The field.
rangeDensifyRangeThe range.
partitionByFieldsExpression<Func<TOutput, object>>[]The partition by fields.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TOutputThe type of the output documents.
Documents<TDocument>(PipelineDefinition<NoPipelineInput, NoPipelineInput>, AggregateExpressionDefinition<NoPipelineInput, IEnumerable<TDocument>>, IBsonSerializer<TDocument>)
Appends a $documents stage to the pipeline.
public static PipelineDefinition<NoPipelineInput, TDocument> Documents<TDocument>(this PipelineDefinition<NoPipelineInput, NoPipelineInput> pipeline, AggregateExpressionDefinition<NoPipelineInput, IEnumerable<TDocument>> documents, IBsonSerializer<TDocument> documentSerializer = null)
Parameters
pipelinePipelineDefinition<NoPipelineInput, NoPipelineInput>The pipeline.
documentsAggregateExpressionDefinition<NoPipelineInput, IEnumerable<TDocument>>The documents.
documentSerializerIBsonSerializer<TDocument>The document serializer.
Returns
- PipelineDefinition<NoPipelineInput, TDocument>
A new pipeline with an additional stage.
Type Parameters
TDocumentThe type of the documents.
Documents<TDocument>(PipelineDefinition<NoPipelineInput, NoPipelineInput>, IEnumerable<TDocument>, IBsonSerializer<TDocument>)
Appends a $documents stage to the pipeline.
public static PipelineDefinition<NoPipelineInput, TDocument> Documents<TDocument>(this PipelineDefinition<NoPipelineInput, NoPipelineInput> pipeline, IEnumerable<TDocument> documents, IBsonSerializer<TDocument> documentSerializer = null)
Parameters
pipelinePipelineDefinition<NoPipelineInput, NoPipelineInput>The pipeline.
documentsIEnumerable<TDocument>The documents.
documentSerializerIBsonSerializer<TDocument>The document serializer.
Returns
- PipelineDefinition<NoPipelineInput, TDocument>
A new pipeline with an additional stage.
Type Parameters
TDocumentThe type of the documents.
Facet<TInput, TIntermediate>(PipelineDefinition<TInput, TIntermediate>, params AggregateFacet<TIntermediate>[])
Appends a $facet stage to the pipeline.
public static PipelineDefinition<TInput, AggregateFacetResults> Facet<TInput, TIntermediate>(this PipelineDefinition<TInput, TIntermediate> pipeline, params AggregateFacet<TIntermediate>[] facets)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
facetsAggregateFacet<TIntermediate>[]The facets.
Returns
- PipelineDefinition<TInput, AggregateFacetResults>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
Facet<TInput, TIntermediate>(PipelineDefinition<TInput, TIntermediate>, IEnumerable<AggregateFacet<TIntermediate>>)
Appends a $facet stage to the pipeline.
public static PipelineDefinition<TInput, AggregateFacetResults> Facet<TInput, TIntermediate>(this PipelineDefinition<TInput, TIntermediate> pipeline, IEnumerable<AggregateFacet<TIntermediate>> facets)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
facetsIEnumerable<AggregateFacet<TIntermediate>>The facets.
Returns
- PipelineDefinition<TInput, AggregateFacetResults>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
Facet<TInput, TIntermediate, TOutput>(PipelineDefinition<TInput, TIntermediate>, params AggregateFacet<TIntermediate>[])
Appends a $facet stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> Facet<TInput, TIntermediate, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, params AggregateFacet<TIntermediate>[] facets)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
facetsAggregateFacet<TIntermediate>[]The facets.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TOutputThe type of the output documents.
Facet<TInput, TIntermediate, TOutput>(PipelineDefinition<TInput, TIntermediate>, IEnumerable<AggregateFacet<TIntermediate>>, AggregateFacetOptions<TOutput>)
Appends a $facet stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> Facet<TInput, TIntermediate, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, IEnumerable<AggregateFacet<TIntermediate>> facets, AggregateFacetOptions<TOutput> options = null)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
facetsIEnumerable<AggregateFacet<TIntermediate>>The facets.
optionsAggregateFacetOptions<TOutput>The options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TOutputThe type of the output documents.
For<TInput>(IBsonSerializer<TInput>)
Used to start creating a pipeline for {TInput} documents.
public static PipelineDefinition<TInput, TInput> For<TInput>(IBsonSerializer<TInput> inputSerializer = null)
Parameters
inputSerializerIBsonSerializer<TInput>The inputSerializer serializer.
Returns
- PipelineDefinition<TInput, TInput>
An empty pipeline.
Type Parameters
TInputThe type of the output.
GraphLookup<TInput, TIntermediate, TFrom>(PipelineDefinition<TInput, TIntermediate>, IMongoCollection<TFrom>, FieldDefinition<TFrom, BsonValue>, FieldDefinition<TFrom, BsonValue>, AggregateExpressionDefinition<TIntermediate, BsonValue>, FieldDefinition<BsonDocument, IEnumerable<BsonDocument>>, FieldDefinition<BsonDocument, int>)
Appends a $graphLookup stage to the pipeline.
public static PipelineDefinition<TInput, BsonDocument> GraphLookup<TInput, TIntermediate, TFrom>(this PipelineDefinition<TInput, TIntermediate> pipeline, IMongoCollection<TFrom> from, FieldDefinition<TFrom, BsonValue> connectFromField, FieldDefinition<TFrom, BsonValue> connectToField, AggregateExpressionDefinition<TIntermediate, BsonValue> startWith, FieldDefinition<BsonDocument, IEnumerable<BsonDocument>> @as, FieldDefinition<BsonDocument, int> depthField = null)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
fromIMongoCollection<TFrom>The from collection.
connectFromFieldFieldDefinition<TFrom, BsonValue>The connect from field.
connectToFieldFieldDefinition<TFrom, BsonValue>The connect to field.
startWithAggregateExpressionDefinition<TIntermediate, BsonValue>The start with value.
asFieldDefinition<BsonDocument, IEnumerable<BsonDocument>>The as field.
depthFieldFieldDefinition<BsonDocument, int>The depth field.
Returns
- PipelineDefinition<TInput, BsonDocument>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TFromThe type of the from documents.
GraphLookup<TInput, TIntermediate, TFrom, TConnectFrom, TConnectTo, TStartWith, TAs, TOutput>(PipelineDefinition<TInput, TIntermediate>, IMongoCollection<TFrom>, FieldDefinition<TFrom, TConnectFrom>, FieldDefinition<TFrom, TConnectTo>, AggregateExpressionDefinition<TIntermediate, TStartWith>, FieldDefinition<TOutput, TAs>, AggregateGraphLookupOptions<TFrom, TFrom, TOutput>)
Appends a $graphLookup stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> GraphLookup<TInput, TIntermediate, TFrom, TConnectFrom, TConnectTo, TStartWith, TAs, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, IMongoCollection<TFrom> from, FieldDefinition<TFrom, TConnectFrom> connectFromField, FieldDefinition<TFrom, TConnectTo> connectToField, AggregateExpressionDefinition<TIntermediate, TStartWith> startWith, FieldDefinition<TOutput, TAs> @as, AggregateGraphLookupOptions<TFrom, TFrom, TOutput> options = null) where TAs : IEnumerable<TFrom>
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
fromIMongoCollection<TFrom>The from collection.
connectFromFieldFieldDefinition<TFrom, TConnectFrom>The connect from field.
connectToFieldFieldDefinition<TFrom, TConnectTo>The connect to field.
startWithAggregateExpressionDefinition<TIntermediate, TStartWith>The start with value.
asFieldDefinition<TOutput, TAs>The as field.
optionsAggregateGraphLookupOptions<TFrom, TFrom, TOutput>The options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate 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, TIntermediate, TFrom, TConnectFrom, TConnectTo, TStartWith, TAs, TOutput>(PipelineDefinition<TInput, TIntermediate>, IMongoCollection<TFrom>, Expression<Func<TFrom, TConnectFrom>>, Expression<Func<TFrom, TConnectTo>>, Expression<Func<TIntermediate, TStartWith>>, Expression<Func<TOutput, TAs>>, AggregateGraphLookupOptions<TFrom, TFrom, TOutput>, ExpressionTranslationOptions)
Appends a $graphLookup stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> GraphLookup<TInput, TIntermediate, TFrom, TConnectFrom, TConnectTo, TStartWith, TAs, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, IMongoCollection<TFrom> from, Expression<Func<TFrom, TConnectFrom>> connectFromField, Expression<Func<TFrom, TConnectTo>> connectToField, Expression<Func<TIntermediate, TStartWith>> startWith, Expression<Func<TOutput, TAs>> @as, AggregateGraphLookupOptions<TFrom, TFrom, TOutput> options = null, ExpressionTranslationOptions translationOptions = null) where TAs : IEnumerable<TFrom>
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
fromIMongoCollection<TFrom>The from collection.
connectFromFieldExpression<Func<TFrom, TConnectFrom>>The connect from field.
connectToFieldExpression<Func<TFrom, TConnectTo>>The connect to field.
startWithExpression<Func<TIntermediate, TStartWith>>The start with value.
asExpression<Func<TOutput, TAs>>The as field.
optionsAggregateGraphLookupOptions<TFrom, TFrom, TOutput>The options.
translationOptionsExpressionTranslationOptionsThe translation options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate 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, TIntermediate, TFrom, TConnectFrom, TConnectTo, TStartWith, TAsElement, TAs, TOutput>(PipelineDefinition<TInput, TIntermediate>, IMongoCollection<TFrom>, FieldDefinition<TFrom, TConnectFrom>, FieldDefinition<TFrom, TConnectTo>, AggregateExpressionDefinition<TIntermediate, TStartWith>, FieldDefinition<TOutput, TAs>, FieldDefinition<TAsElement, int>, AggregateGraphLookupOptions<TFrom, TAsElement, TOutput>)
Appends a $graphLookup stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> GraphLookup<TInput, TIntermediate, TFrom, TConnectFrom, TConnectTo, TStartWith, TAsElement, TAs, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, IMongoCollection<TFrom> from, FieldDefinition<TFrom, TConnectFrom> connectFromField, FieldDefinition<TFrom, TConnectTo> connectToField, AggregateExpressionDefinition<TIntermediate, TStartWith> startWith, FieldDefinition<TOutput, TAs> @as, FieldDefinition<TAsElement, int> depthField, AggregateGraphLookupOptions<TFrom, TAsElement, TOutput> options = null) where TAs : IEnumerable<TAsElement>
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
fromIMongoCollection<TFrom>The from collection.
connectFromFieldFieldDefinition<TFrom, TConnectFrom>The connect from field.
connectToFieldFieldDefinition<TFrom, TConnectTo>The connect to field.
startWithAggregateExpressionDefinition<TIntermediate, TStartWith>The start with value.
asFieldDefinition<TOutput, TAs>The as field.
depthFieldFieldDefinition<TAsElement, int>The depth field.
optionsAggregateGraphLookupOptions<TFrom, TAsElement, TOutput>The options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate 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, TIntermediate, TFrom, TConnectFrom, TConnectTo, TStartWith, TAsElement, TAs, TOutput>(PipelineDefinition<TInput, TIntermediate>, IMongoCollection<TFrom>, Expression<Func<TFrom, TConnectFrom>>, Expression<Func<TFrom, TConnectTo>>, Expression<Func<TIntermediate, TStartWith>>, Expression<Func<TOutput, TAs>>, Expression<Func<TAsElement, int>>, AggregateGraphLookupOptions<TFrom, TAsElement, TOutput>, ExpressionTranslationOptions)
Appends a $graphLookup stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> GraphLookup<TInput, TIntermediate, TFrom, TConnectFrom, TConnectTo, TStartWith, TAsElement, TAs, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, IMongoCollection<TFrom> from, Expression<Func<TFrom, TConnectFrom>> connectFromField, Expression<Func<TFrom, TConnectTo>> connectToField, Expression<Func<TIntermediate, 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
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
fromIMongoCollection<TFrom>The from collection.
connectFromFieldExpression<Func<TFrom, TConnectFrom>>The connect from field.
connectToFieldExpression<Func<TFrom, TConnectTo>>The connect to field.
startWithExpression<Func<TIntermediate, 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
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate 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, TIntermediate>(PipelineDefinition<TInput, TIntermediate>, ProjectionDefinition<TIntermediate, BsonDocument>)
Appends a group stage to the pipeline.
public static PipelineDefinition<TInput, BsonDocument> Group<TInput, TIntermediate>(this PipelineDefinition<TInput, TIntermediate> pipeline, ProjectionDefinition<TIntermediate, BsonDocument> group)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
groupProjectionDefinition<TIntermediate, BsonDocument>The group projection.
Returns
- PipelineDefinition<TInput, BsonDocument>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
Group<TInput, TIntermediate, TOutput>(PipelineDefinition<TInput, TIntermediate>, ProjectionDefinition<TIntermediate, TOutput>)
Appends a $group stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> Group<TInput, TIntermediate, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, ProjectionDefinition<TIntermediate, TOutput> group)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
groupProjectionDefinition<TIntermediate, TOutput>The group projection.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TOutputThe type of the output documents.
Group<TInput, TIntermediate, TKey, TOutput>(PipelineDefinition<TInput, TIntermediate>, Expression<Func<TIntermediate, TKey>>, Expression<Func<IGrouping<TKey, TIntermediate>, TOutput>>, ExpressionTranslationOptions)
Appends a group stage to the pipeline (this method can only be used with LINQ2).
public static PipelineDefinition<TInput, TOutput> Group<TInput, TIntermediate, TKey, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, Expression<Func<TIntermediate, TKey>> id, Expression<Func<IGrouping<TKey, TIntermediate>, TOutput>> group, ExpressionTranslationOptions translationOptions = null)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
idExpression<Func<TIntermediate, TKey>>The id.
groupExpression<Func<IGrouping<TKey, TIntermediate>, TOutput>>The group projection.
translationOptionsExpressionTranslationOptionsThe translation options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TKeyThe type of the key.
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, TOutput>(PipelineDefinition<TInput, TOutput>, long)
Appends a $limit stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> Limit<TInput, TOutput>(this PipelineDefinition<TInput, TOutput> pipeline, long limit)
Parameters
pipelinePipelineDefinition<TInput, TOutput>The pipeline.
limitlongThe limit.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TOutputThe type of the output documents.
Lookup<TInput, TIntermediate, TForeignDocument, TOutput>(PipelineDefinition<TInput, TIntermediate>, IMongoCollection<TForeignDocument>, FieldDefinition<TIntermediate>, FieldDefinition<TForeignDocument>, FieldDefinition<TOutput>, AggregateLookupOptions<TForeignDocument, TOutput>)
Appends a $lookup stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> Lookup<TInput, TIntermediate, TForeignDocument, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, IMongoCollection<TForeignDocument> foreignCollection, FieldDefinition<TIntermediate> localField, FieldDefinition<TForeignDocument> foreignField, FieldDefinition<TOutput> @as, AggregateLookupOptions<TForeignDocument, TOutput> options = null)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
foreignCollectionIMongoCollection<TForeignDocument>The foreign collection.
localFieldFieldDefinition<TIntermediate>The local field.
foreignFieldFieldDefinition<TForeignDocument>The foreign field.
asFieldDefinition<TOutput>The "as" field.
optionsAggregateLookupOptions<TForeignDocument, TOutput>The options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TForeignDocumentThe type of the foreign collection documents.
TOutputThe type of the output documents.
Lookup<TInput, TIntermediate, TForeignDocument, TOutput>(PipelineDefinition<TInput, TIntermediate>, IMongoCollection<TForeignDocument>, Expression<Func<TIntermediate, object>>, Expression<Func<TForeignDocument, object>>, Expression<Func<TOutput, object>>, AggregateLookupOptions<TForeignDocument, TOutput>)
Appends a lookup stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> Lookup<TInput, TIntermediate, TForeignDocument, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, IMongoCollection<TForeignDocument> foreignCollection, Expression<Func<TIntermediate, object>> localField, Expression<Func<TForeignDocument, object>> foreignField, Expression<Func<TOutput, object>> @as, AggregateLookupOptions<TForeignDocument, TOutput> options = null)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
foreignCollectionIMongoCollection<TForeignDocument>The foreign collection.
localFieldExpression<Func<TIntermediate, object>>The local field.
foreignFieldExpression<Func<TForeignDocument, object>>The foreign field.
asExpression<Func<TOutput, object>>The "as" field.
optionsAggregateLookupOptions<TForeignDocument, TOutput>The options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TForeignDocumentThe type of the foreign collection documents.
TOutputThe type of the output documents.
Lookup<TInput, TIntermediate, TForeignDocument, TAsElement, TAs, TOutput>(PipelineDefinition<TInput, TIntermediate>, IMongoCollection<TForeignDocument>, BsonDocument, PipelineDefinition<TForeignDocument, TAsElement>, FieldDefinition<TOutput, TAs>, AggregateLookupOptions<TForeignDocument, TOutput>)
Appends a $lookup stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> Lookup<TInput, TIntermediate, TForeignDocument, TAsElement, TAs, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, IMongoCollection<TForeignDocument> foreignCollection, BsonDocument let, PipelineDefinition<TForeignDocument, TAsElement> lookupPipeline, FieldDefinition<TOutput, TAs> @as, AggregateLookupOptions<TForeignDocument, TOutput> options = null) where TAs : IEnumerable<TAsElement>
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
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
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate 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, TIntermediate, TForeignDocument, TAsElement, TAs, TOutput>(PipelineDefinition<TInput, TIntermediate>, IMongoCollection<TForeignDocument>, BsonDocument, PipelineDefinition<TForeignDocument, TAsElement>, Expression<Func<TOutput, TAs>>, AggregateLookupOptions<TForeignDocument, TOutput>)
Appends a $lookup stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> Lookup<TInput, TIntermediate, TForeignDocument, TAsElement, TAs, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, IMongoCollection<TForeignDocument> foreignCollection, BsonDocument let, PipelineDefinition<TForeignDocument, TAsElement> lookupPipeline, Expression<Func<TOutput, TAs>> @as, AggregateLookupOptions<TForeignDocument, TOutput> options = null) where TAs : IEnumerable<TAsElement>
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
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
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate 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, TOutput>(PipelineDefinition<TInput, TOutput>, FilterDefinition<TOutput>)
Appends a $match stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> Match<TInput, TOutput>(this PipelineDefinition<TInput, TOutput> pipeline, FilterDefinition<TOutput> filter)
Parameters
pipelinePipelineDefinition<TInput, TOutput>The pipeline.
filterFilterDefinition<TOutput>The filter.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TOutputThe type of the output documents.
Match<TInput, TOutput>(PipelineDefinition<TInput, TOutput>, Expression<Func<TOutput, bool>>)
Appends a match stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> Match<TInput, TOutput>(this PipelineDefinition<TInput, TOutput> pipeline, Expression<Func<TOutput, bool>> filter)
Parameters
pipelinePipelineDefinition<TInput, TOutput>The pipeline.
filterExpression<Func<TOutput, bool>>The filter.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TOutputThe type of the output documents.
Merge<TInput, TIntermediate, TOutput>(PipelineDefinition<TInput, TIntermediate>, IMongoCollection<TOutput>, MergeStageOptions<TOutput>)
Appends a $merge stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> Merge<TInput, TIntermediate, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, IMongoCollection<TOutput> outputCollection, MergeStageOptions<TOutput> mergeOptions)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
outputCollectionIMongoCollection<TOutput>The output collection.
mergeOptionsMergeStageOptions<TOutput>The merge options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TOutputThe type of the output documents.
Exceptions
OfType<TInput, TIntermediate, TOutput>(PipelineDefinition<TInput, TIntermediate>, IBsonSerializer<TOutput>)
Appends a $match stage to the pipeline to select documents of a certain type.
public static PipelineDefinition<TInput, TOutput> OfType<TInput, TIntermediate, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, IBsonSerializer<TOutput> outputSerializer = null) where TOutput : TIntermediate
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
outputSerializerIBsonSerializer<TOutput>The output serializer.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TOutputThe type of the output documents.
Exceptions
Out<TInput, TOutput>(PipelineDefinition<TInput, TOutput>, IMongoCollection<TOutput>)
Appends a $out stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> Out<TInput, TOutput>(this PipelineDefinition<TInput, TOutput> pipeline, IMongoCollection<TOutput> outputCollection)
Parameters
pipelinePipelineDefinition<TInput, TOutput>The pipeline.
outputCollectionIMongoCollection<TOutput>The output collection.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TOutputThe type of the output documents.
Exceptions
Project<TInput, TIntermediate>(PipelineDefinition<TInput, TIntermediate>, ProjectionDefinition<TIntermediate, BsonDocument>)
Appends a project stage to the pipeline.
public static PipelineDefinition<TInput, BsonDocument> Project<TInput, TIntermediate>(this PipelineDefinition<TInput, TIntermediate> pipeline, ProjectionDefinition<TIntermediate, BsonDocument> projection)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
projectionProjectionDefinition<TIntermediate, BsonDocument>The projection.
Returns
- PipelineDefinition<TInput, BsonDocument>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
Project<TInput, TIntermediate, TOutput>(PipelineDefinition<TInput, TIntermediate>, ProjectionDefinition<TIntermediate, TOutput>)
Appends a $project stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> Project<TInput, TIntermediate, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, ProjectionDefinition<TIntermediate, TOutput> projection)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
projectionProjectionDefinition<TIntermediate, TOutput>The projection.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TOutputThe type of the output documents.
Exceptions
Project<TInput, TIntermediate, TOutput>(PipelineDefinition<TInput, TIntermediate>, Expression<Func<TIntermediate, TOutput>>, ExpressionTranslationOptions)
Appends a project stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> Project<TInput, TIntermediate, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, Expression<Func<TIntermediate, TOutput>> projection, ExpressionTranslationOptions translationOptions = null)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
projectionExpression<Func<TIntermediate, TOutput>>The projection.
translationOptionsExpressionTranslationOptionsThe translation options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TOutputThe type of the output documents.
ReplaceRoot<TInput, TIntermediate, TOutput>(PipelineDefinition<TInput, TIntermediate>, AggregateExpressionDefinition<TIntermediate, TOutput>)
Appends a $replaceRoot stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> ReplaceRoot<TInput, TIntermediate, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, AggregateExpressionDefinition<TIntermediate, TOutput> newRoot)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
newRootAggregateExpressionDefinition<TIntermediate, TOutput>The new root.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TOutputThe type of the output documents.
ReplaceRoot<TInput, TIntermediate, TOutput>(PipelineDefinition<TInput, TIntermediate>, Expression<Func<TIntermediate, TOutput>>, ExpressionTranslationOptions)
Appends a $replaceRoot stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> ReplaceRoot<TInput, TIntermediate, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, Expression<Func<TIntermediate, TOutput>> newRoot, ExpressionTranslationOptions translationOptions = null)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
newRootExpression<Func<TIntermediate, TOutput>>The new root.
translationOptionsExpressionTranslationOptionsThe translation options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TOutputThe type of the output documents.
ReplaceWith<TInput, TIntermediate, TOutput>(PipelineDefinition<TInput, TIntermediate>, AggregateExpressionDefinition<TIntermediate, TOutput>)
Appends a $replaceWith stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> ReplaceWith<TInput, TIntermediate, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, AggregateExpressionDefinition<TIntermediate, TOutput> newRoot)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
newRootAggregateExpressionDefinition<TIntermediate, TOutput>The new root.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TOutputThe type of the output documents.
ReplaceWith<TInput, TIntermediate, TOutput>(PipelineDefinition<TInput, TIntermediate>, Expression<Func<TIntermediate, TOutput>>, ExpressionTranslationOptions)
Appends a $replaceWith stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> ReplaceWith<TInput, TIntermediate, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, Expression<Func<TIntermediate, TOutput>> newRoot, ExpressionTranslationOptions translationOptions = null)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
newRootExpression<Func<TIntermediate, TOutput>>The new root.
translationOptionsExpressionTranslationOptionsThe translation options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TOutputThe type of the output documents.
SearchMeta<TInput, TOutput>(PipelineDefinition<TInput, TOutput>, SearchDefinition<TOutput>, string, SearchCountOptions)
Appends a $searchMeta stage to the pipeline.
public static PipelineDefinition<TInput, SearchMetaResult> SearchMeta<TInput, TOutput>(this PipelineDefinition<TInput, TOutput> pipeline, SearchDefinition<TOutput> query, string indexName = null, SearchCountOptions count = null)
Parameters
pipelinePipelineDefinition<TInput, TOutput>The pipeline.
querySearchDefinition<TOutput>The search definition.
indexNamestringThe index name.
countSearchCountOptionsThe count options.
Returns
- PipelineDefinition<TInput, SearchMetaResult>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TOutputThe type of the output documents.
Search<TInput, TOutput>(PipelineDefinition<TInput, TOutput>, SearchDefinition<TOutput>, SearchHighlightOptions<TOutput>, string, SearchCountOptions, bool, bool)
Appends a $search stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> Search<TInput, TOutput>(this PipelineDefinition<TInput, TOutput> pipeline, SearchDefinition<TOutput> searchDefinition, SearchHighlightOptions<TOutput> highlight = null, string indexName = null, SearchCountOptions count = null, bool returnStoredSource = false, bool scoreDetails = false)
Parameters
pipelinePipelineDefinition<TInput, TOutput>The pipeline.
searchDefinitionSearchDefinition<TOutput>The search definition.
highlightSearchHighlightOptions<TOutput>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
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TOutputThe type of the output documents.
Search<TInput, TOutput>(PipelineDefinition<TInput, TOutput>, SearchDefinition<TOutput>, SearchOptions<TOutput>)
Appends a $search stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> Search<TInput, TOutput>(this PipelineDefinition<TInput, TOutput> pipeline, SearchDefinition<TOutput> searchDefinition, SearchOptions<TOutput> searchOptions)
Parameters
pipelinePipelineDefinition<TInput, TOutput>The pipeline.
searchDefinitionSearchDefinition<TOutput>The search definition.
searchOptionsSearchOptions<TOutput>The search options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TOutputThe type of the output documents.
SetWindowFields<TInput, TIntermediate, TWindowFields>(PipelineDefinition<TInput, TIntermediate>, AggregateExpressionDefinition<ISetWindowFieldsPartition<TIntermediate>, TWindowFields>)
Create a $setWindowFields stage.
public static PipelineDefinition<TInput, BsonDocument> SetWindowFields<TInput, TIntermediate, TWindowFields>(this PipelineDefinition<TInput, TIntermediate> pipeline, AggregateExpressionDefinition<ISetWindowFieldsPartition<TIntermediate>, TWindowFields> output)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
outputAggregateExpressionDefinition<ISetWindowFieldsPartition<TIntermediate>, TWindowFields>The window fields expression.
Returns
- PipelineDefinition<TInput, BsonDocument>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TWindowFieldsThe type of the added window fields.
SetWindowFields<TInput, TIntermediate, TPartitionBy, TWindowFields>(PipelineDefinition<TInput, TIntermediate>, AggregateExpressionDefinition<TIntermediate, TPartitionBy>, AggregateExpressionDefinition<ISetWindowFieldsPartition<TIntermediate>, TWindowFields>)
Appends a $setWindowFields stage to the pipeline.
public static PipelineDefinition<TInput, BsonDocument> SetWindowFields<TInput, TIntermediate, TPartitionBy, TWindowFields>(this PipelineDefinition<TInput, TIntermediate> pipeline, AggregateExpressionDefinition<TIntermediate, TPartitionBy> partitionBy, AggregateExpressionDefinition<ISetWindowFieldsPartition<TIntermediate>, TWindowFields> output)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
partitionByAggregateExpressionDefinition<TIntermediate, TPartitionBy>The partitionBy expression.
outputAggregateExpressionDefinition<ISetWindowFieldsPartition<TIntermediate>, TWindowFields>The window fields expression.
Returns
- PipelineDefinition<TInput, BsonDocument>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TPartitionByThe type of the value to partition by.
TWindowFieldsThe type of the added window fields.
SetWindowFields<TInput, TIntermediate, TPartitionBy, TWindowFields>(PipelineDefinition<TInput, TIntermediate>, AggregateExpressionDefinition<TIntermediate, TPartitionBy>, SortDefinition<TIntermediate>, AggregateExpressionDefinition<ISetWindowFieldsPartition<TIntermediate>, TWindowFields>)
Appends a $setWindowFields stage to the pipeline.
public static PipelineDefinition<TInput, BsonDocument> SetWindowFields<TInput, TIntermediate, TPartitionBy, TWindowFields>(this PipelineDefinition<TInput, TIntermediate> pipeline, AggregateExpressionDefinition<TIntermediate, TPartitionBy> partitionBy, SortDefinition<TIntermediate> sortBy, AggregateExpressionDefinition<ISetWindowFieldsPartition<TIntermediate>, TWindowFields> output)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
partitionByAggregateExpressionDefinition<TIntermediate, TPartitionBy>The partitionBy expression.
sortBySortDefinition<TIntermediate>The sortBy expression.
outputAggregateExpressionDefinition<ISetWindowFieldsPartition<TIntermediate>, TWindowFields>The window fields expression.
Returns
- PipelineDefinition<TInput, BsonDocument>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TPartitionByThe type of the value to partition by.
TWindowFieldsThe type of the added window fields.
SetWindowFields<TInput, TIntermediate, TPartitionBy, TWindowFields>(PipelineDefinition<TInput, TIntermediate>, Expression<Func<ISetWindowFieldsPartition<TIntermediate>, TWindowFields>>)
Appends a $setWindowFields stage to the pipeline.
public static PipelineDefinition<TInput, BsonDocument> SetWindowFields<TInput, TIntermediate, TPartitionBy, TWindowFields>(this PipelineDefinition<TInput, TIntermediate> pipeline, Expression<Func<ISetWindowFieldsPartition<TIntermediate>, TWindowFields>> output)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
outputExpression<Func<ISetWindowFieldsPartition<TIntermediate>, TWindowFields>>The window fields expression.
Returns
- PipelineDefinition<TInput, BsonDocument>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TPartitionByThe type of the value to partition by.
TWindowFieldsThe type of the added window fields.
SetWindowFields<TInput, TIntermediate, TPartitionBy, TWindowFields>(PipelineDefinition<TInput, TIntermediate>, Expression<Func<TIntermediate, TPartitionBy>>, SortDefinition<TIntermediate>, Expression<Func<ISetWindowFieldsPartition<TIntermediate>, TWindowFields>>)
Appends a $setWindowFields stage to the pipeline.
public static PipelineDefinition<TInput, BsonDocument> SetWindowFields<TInput, TIntermediate, TPartitionBy, TWindowFields>(this PipelineDefinition<TInput, TIntermediate> pipeline, Expression<Func<TIntermediate, TPartitionBy>> partitionBy, SortDefinition<TIntermediate> sortBy, Expression<Func<ISetWindowFieldsPartition<TIntermediate>, TWindowFields>> output)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
partitionByExpression<Func<TIntermediate, TPartitionBy>>The partitionBy expression.
sortBySortDefinition<TIntermediate>The sortBy expression.
outputExpression<Func<ISetWindowFieldsPartition<TIntermediate>, TWindowFields>>The window fields expression.
Returns
- PipelineDefinition<TInput, BsonDocument>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TPartitionByThe type of the value to partition by.
TWindowFieldsThe type of the added window fields.
SetWindowFields<TInput, TIntermediate, TPartitionBy, TWindowFields>(PipelineDefinition<TInput, TIntermediate>, Expression<Func<TIntermediate, TPartitionBy>>, Expression<Func<ISetWindowFieldsPartition<TIntermediate>, TWindowFields>>)
Appends a $setWindowFields stage to the pipeline.
public static PipelineDefinition<TInput, BsonDocument> SetWindowFields<TInput, TIntermediate, TPartitionBy, TWindowFields>(this PipelineDefinition<TInput, TIntermediate> pipeline, Expression<Func<TIntermediate, TPartitionBy>> partitionBy, Expression<Func<ISetWindowFieldsPartition<TIntermediate>, TWindowFields>> output)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
partitionByExpression<Func<TIntermediate, TPartitionBy>>The partitionBy expression.
outputExpression<Func<ISetWindowFieldsPartition<TIntermediate>, TWindowFields>>The window fields expression.
Returns
- PipelineDefinition<TInput, BsonDocument>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TPartitionByThe type of the value to partition by.
TWindowFieldsThe type of the added window fields.
Set<TInput, TOutput>(PipelineDefinition<TInput, TOutput>, SetFieldDefinitions<TOutput>)
Appends a $set stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> Set<TInput, TOutput>(this PipelineDefinition<TInput, TOutput> pipeline, SetFieldDefinitions<TOutput> fields)
Parameters
pipelinePipelineDefinition<TInput, TOutput>The pipeline.
fieldsSetFieldDefinitions<TOutput>The fields to set.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TOutputThe type of the output documents.
Set<TInput, TOutput, TFields>(PipelineDefinition<TInput, TOutput>, Expression<Func<TOutput, TFields>>)
Appends a $set stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> Set<TInput, TOutput, TFields>(this PipelineDefinition<TInput, TOutput> pipeline, Expression<Func<TOutput, TFields>> fields)
Parameters
pipelinePipelineDefinition<TInput, TOutput>The pipeline.
fieldsExpression<Func<TOutput, TFields>>The fields to set.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TOutputThe type of the output documents.
TFieldsThe type of object specifying the fields to set.
Skip<TInput, TOutput>(PipelineDefinition<TInput, TOutput>, long)
Appends a $skip stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> Skip<TInput, TOutput>(this PipelineDefinition<TInput, TOutput> pipeline, long skip)
Parameters
pipelinePipelineDefinition<TInput, TOutput>The pipeline.
skiplongThe number of documents to skip.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TOutputThe type of the output documents.
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
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
valueAggregateExpressionDefinition<TIntermediate, TValue>The value expression.
Returns
- PipelineDefinition<TInput, AggregateSortByCountResult<TValue>>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TValueThe 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
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
valueExpression<Func<TIntermediate, TValue>>The value expression.
translationOptionsExpressionTranslationOptionsThe translation options.
Returns
- PipelineDefinition<TInput, AggregateSortByCountResult<TValue>>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TValueThe type of the values.
Sort<TInput, TOutput>(PipelineDefinition<TInput, TOutput>, SortDefinition<TOutput>)
Appends a $sort stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> Sort<TInput, TOutput>(this PipelineDefinition<TInput, TOutput> pipeline, SortDefinition<TOutput> sort)
Parameters
pipelinePipelineDefinition<TInput, TOutput>The pipeline.
sortSortDefinition<TOutput>The sort definition.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TOutputThe type of the output documents.
UnionWith<TInput, TWith, TOutput>(PipelineDefinition<TInput, TOutput>, IMongoCollection<TWith>, PipelineDefinition<TWith, TOutput>)
Appends a $unionWith stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> UnionWith<TInput, TWith, TOutput>(this PipelineDefinition<TInput, TOutput> pipeline, IMongoCollection<TWith> withCollection, PipelineDefinition<TWith, TOutput> withPipeline = null)
Parameters
pipelinePipelineDefinition<TInput, TOutput>The pipeline.
withCollectionIMongoCollection<TWith>The with collection.
withPipelinePipelineDefinition<TWith, TOutput>The with pipeline.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TWithThe type of the with collection documents.
TOutputThe type of the output documents.
Unwind<TInput, TIntermediate>(PipelineDefinition<TInput, TIntermediate>, FieldDefinition<TIntermediate>, AggregateUnwindOptions<BsonDocument>)
Appends an unwind stage to the pipeline.
public static PipelineDefinition<TInput, BsonDocument> Unwind<TInput, TIntermediate>(this PipelineDefinition<TInput, TIntermediate> pipeline, FieldDefinition<TIntermediate> field, AggregateUnwindOptions<BsonDocument> options = null)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
fieldFieldDefinition<TIntermediate>The field to unwind.
optionsAggregateUnwindOptions<BsonDocument>The options.
Returns
- PipelineDefinition<TInput, BsonDocument>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
Unwind<TInput, TIntermediate>(PipelineDefinition<TInput, TIntermediate>, Expression<Func<TIntermediate, object>>, AggregateUnwindOptions<BsonDocument>)
Appends an unwind stage to the pipeline.
public static PipelineDefinition<TInput, BsonDocument> Unwind<TInput, TIntermediate>(this PipelineDefinition<TInput, TIntermediate> pipeline, Expression<Func<TIntermediate, object>> field, AggregateUnwindOptions<BsonDocument> options = null)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
fieldExpression<Func<TIntermediate, object>>The field to unwind.
optionsAggregateUnwindOptions<BsonDocument>The options.
Returns
- PipelineDefinition<TInput, BsonDocument>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
Unwind<TInput, TIntermediate, TOutput>(PipelineDefinition<TInput, TIntermediate>, FieldDefinition<TIntermediate>, AggregateUnwindOptions<TOutput>)
Appends an $unwind stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> Unwind<TInput, TIntermediate, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, FieldDefinition<TIntermediate> field, AggregateUnwindOptions<TOutput> options = null)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
fieldFieldDefinition<TIntermediate>The field.
optionsAggregateUnwindOptions<TOutput>The options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TOutputThe type of the output documents.
Unwind<TInput, TIntermediate, TOutput>(PipelineDefinition<TInput, TIntermediate>, Expression<Func<TIntermediate, object>>, AggregateUnwindOptions<TOutput>)
Appends an unwind stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> Unwind<TInput, TIntermediate, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, Expression<Func<TIntermediate, object>> field, AggregateUnwindOptions<TOutput> options = null)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
fieldExpression<Func<TIntermediate, object>>The field to unwind.
optionsAggregateUnwindOptions<TOutput>The options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TOutputThe type of the output documents.
VectorSearch<TInput, TOutput>(PipelineDefinition<TInput, TOutput>, FieldDefinition<TOutput>, QueryVector, int, VectorSearchOptions<TOutput>)
Appends a $vectorSearch stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> VectorSearch<TInput, TOutput>(this PipelineDefinition<TInput, TOutput> pipeline, FieldDefinition<TOutput> field, QueryVector queryVector, int limit, VectorSearchOptions<TOutput> options = null)
Parameters
pipelinePipelineDefinition<TInput, TOutput>The pipeline.
fieldFieldDefinition<TOutput>The field.
queryVectorQueryVectorThe query vector.
limitintThe limit.
optionsVectorSearchOptions<TOutput>The vector search options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input.
TOutputThe type of the output.
VectorSearch<TInput, TField, TOutput>(PipelineDefinition<TInput, TOutput>, Expression<Func<TOutput, TField>>, QueryVector, int, VectorSearchOptions<TOutput>)
Appends a $vectorSearch stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> VectorSearch<TInput, TField, TOutput>(this PipelineDefinition<TInput, TOutput> pipeline, Expression<Func<TOutput, TField>> field, QueryVector queryVector, int limit, VectorSearchOptions<TOutput> options = null)
Parameters
pipelinePipelineDefinition<TInput, TOutput>The pipeline.
fieldExpression<Func<TOutput, TField>>The field.
queryVectorQueryVectorThe query vector.
limitintThe limit.
optionsVectorSearchOptions<TOutput>The vector search options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input.
TFieldThe type of the field.
TOutputThe type of the output.