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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
stage
PipelineStageDefinition<TIntermediate, TOutput>The stage.
outputSerializer
IBsonSerializer<TOutput>The output serializer.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
outputSerializer
IBsonSerializer<TOutput>The output serializer.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
groupBy
Expression<Func<TIntermediate, TValue>>The group by expression.
buckets
intThe number of buckets.
output
Expression<Func<IGrouping<TValue, TIntermediate>, TOutput>>The output projection.
options
AggregateBucketAutoOptionsThe options (optional).
translationOptions
ExpressionTranslationOptionsThe translation options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TValue
The type of the value.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
groupBy
AggregateExpressionDefinition<TIntermediate, TValue>The group by expression.
buckets
intThe number of buckets.
options
AggregateBucketAutoOptionsThe options.
Returns
- PipelineDefinition<TInput, AggregateBucketAutoResult<TValue>>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TValue
The type of the values.
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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
groupBy
Expression<Func<TIntermediate, TValue>>The group by expression.
buckets
intThe number of buckets.
options
AggregateBucketAutoOptionsThe options (optional).
translationOptions
ExpressionTranslationOptionsThe translation options.
Returns
- PipelineDefinition<TInput, AggregateBucketAutoResult<TValue>>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TValue
The type of the 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
groupBy
AggregateExpressionDefinition<TIntermediate, TValue>The group by expression.
buckets
intThe number of buckets.
output
ProjectionDefinition<TIntermediate, TOutput>The output projection.
options
AggregateBucketAutoOptionsThe options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TValue
The type of the values.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
groupBy
Expression<Func<TIntermediate, TValue>>The group by expression.
buckets
intThe number of buckets.
output
Expression<Func<IGrouping<AggregateBucketAutoResultId<TValue>, TIntermediate>, TOutput>>The output projection.
options
AggregateBucketAutoOptionsThe options (optional).
translationOptions
ExpressionTranslationOptionsThe translation options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TValue
The type of the value.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
groupBy
AggregateExpressionDefinition<TIntermediate, TValue>The group by expression.
boundaries
IEnumerable<TValue>The boundaries.
options
AggregateBucketOptions<TValue>The options.
Returns
- PipelineDefinition<TInput, AggregateBucketResult<TValue>>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TValue
The type of the values.
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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
groupBy
Expression<Func<TIntermediate, TValue>>The group by expression.
boundaries
IEnumerable<TValue>The boundaries.
options
AggregateBucketOptions<TValue>The options.
translationOptions
ExpressionTranslationOptionsThe translation options.
Returns
- PipelineDefinition<TInput, AggregateBucketResult<TValue>>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TValue
The type of the values.
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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
groupBy
AggregateExpressionDefinition<TIntermediate, TValue>The group by expression.
boundaries
IEnumerable<TValue>The boundaries.
output
ProjectionDefinition<TIntermediate, TOutput>The output projection.
options
AggregateBucketOptions<TValue>The options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TValue
The type of the values.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
groupBy
Expression<Func<TIntermediate, TValue>>The group by expression.
boundaries
IEnumerable<TValue>The boundaries.
output
Expression<Func<IGrouping<TValue, TIntermediate>, TOutput>>The output projection.
options
AggregateBucketOptions<TValue>The options.
translationOptions
ExpressionTranslationOptionsThe translation options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TValue
The type of the values.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
options
ChangeStreamStageOptionsThe options.
Returns
- PipelineDefinition<TInput, ChangeStreamDocument<TIntermediate>>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
Returns
- PipelineDefinition<TInput, AggregateCountResult>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The 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
pipeline
PipelineDefinition<TInput, TOutput>The pipeline.
field
FieldDefinition<TOutput>The field.
range
DensifyRangeThe range.
partitionByFields
FieldDefinition<TOutput>[]The partition by fields.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TOutput>The pipeline.
field
FieldDefinition<TOutput>The field.
range
DensifyRangeThe range.
partitionByFields
IEnumerable<FieldDefinition<TOutput>>The partition by fields.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TOutput>The pipeline.
field
Expression<Func<TOutput, object>>The field.
range
DensifyRangeThe range.
partitionByFields
IEnumerable<Expression<Func<TOutput, object>>>The partition by fields.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TOutput>The pipeline.
field
Expression<Func<TOutput, object>>The field.
range
DensifyRangeThe range.
partitionByFields
Expression<Func<TOutput, object>>[]The partition by fields.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TOutput
The 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
pipeline
PipelineDefinition<NoPipelineInput, NoPipelineInput>The pipeline.
documents
AggregateExpressionDefinition<NoPipelineInput, IEnumerable<TDocument>>The documents.
documentSerializer
IBsonSerializer<TDocument>The document serializer.
Returns
- PipelineDefinition<NoPipelineInput, TDocument>
A new pipeline with an additional stage.
Type Parameters
TDocument
The 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
pipeline
PipelineDefinition<NoPipelineInput, NoPipelineInput>The pipeline.
documents
IEnumerable<TDocument>The documents.
documentSerializer
IBsonSerializer<TDocument>The document serializer.
Returns
- PipelineDefinition<NoPipelineInput, TDocument>
A new pipeline with an additional stage.
Type Parameters
TDocument
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
facets
AggregateFacet<TIntermediate>[]The facets.
Returns
- PipelineDefinition<TInput, AggregateFacetResults>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
facets
IEnumerable<AggregateFacet<TIntermediate>>The facets.
Returns
- PipelineDefinition<TInput, AggregateFacetResults>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
facets
AggregateFacet<TIntermediate>[]The facets.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
facets
IEnumerable<AggregateFacet<TIntermediate>>The facets.
options
AggregateFacetOptions<TOutput>The options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TOutput
The 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
inputSerializer
IBsonSerializer<TInput>The inputSerializer serializer.
Returns
- PipelineDefinition<TInput, TInput>
An empty pipeline.
Type Parameters
TInput
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
from
IMongoCollection<TFrom>The from collection.
connectFromField
FieldDefinition<TFrom, BsonValue>The connect from field.
connectToField
FieldDefinition<TFrom, BsonValue>The connect to field.
startWith
AggregateExpressionDefinition<TIntermediate, BsonValue>The start with value.
as
FieldDefinition<BsonDocument, IEnumerable<BsonDocument>>The as field.
depthField
FieldDefinition<BsonDocument, int>The depth field.
Returns
- PipelineDefinition<TInput, BsonDocument>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TFrom
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
from
IMongoCollection<TFrom>The from collection.
connectFromField
FieldDefinition<TFrom, TConnectFrom>The connect from field.
connectToField
FieldDefinition<TFrom, TConnectTo>The connect to field.
startWith
AggregateExpressionDefinition<TIntermediate, TStartWith>The start with value.
as
FieldDefinition<TOutput, TAs>The as field.
options
AggregateGraphLookupOptions<TFrom, TFrom, TOutput>The options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TFrom
The type of the from documents.
TConnectFrom
The type of the connect from field (must be either TConnectTo or a type that implements IEnumerable{TConnectTo}).
TConnectTo
The type of the connect to field.
TStartWith
The type of the start with expression (must be either TConnectTo or a type that implements IEnumerable{TConnectTo}).
TAs
The type of the as field.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
from
IMongoCollection<TFrom>The from collection.
connectFromField
Expression<Func<TFrom, TConnectFrom>>The connect from field.
connectToField
Expression<Func<TFrom, TConnectTo>>The connect to field.
startWith
Expression<Func<TIntermediate, TStartWith>>The start with value.
as
Expression<Func<TOutput, TAs>>The as field.
options
AggregateGraphLookupOptions<TFrom, TFrom, TOutput>The options.
translationOptions
ExpressionTranslationOptionsThe translation options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TFrom
The type of the from documents.
TConnectFrom
The type of the connect from field (must be either TConnectTo or a type that implements IEnumerable{TConnectTo}).
TConnectTo
The type of the connect to field.
TStartWith
The type of the start with expression (must be either TConnectTo or a type that implements IEnumerable{TConnectTo}).
TAs
The type of the as field.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
from
IMongoCollection<TFrom>The from collection.
connectFromField
FieldDefinition<TFrom, TConnectFrom>The connect from field.
connectToField
FieldDefinition<TFrom, TConnectTo>The connect to field.
startWith
AggregateExpressionDefinition<TIntermediate, TStartWith>The start with value.
as
FieldDefinition<TOutput, TAs>The as field.
depthField
FieldDefinition<TAsElement, int>The depth field.
options
AggregateGraphLookupOptions<TFrom, TAsElement, TOutput>The options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TFrom
The type of the from documents.
TConnectFrom
The type of the connect from field (must be either TConnectTo or a type that implements IEnumerable{TConnectTo}).
TConnectTo
The type of the connect to field.
TStartWith
The type of the start with expression (must be either TConnectTo or a type that implements IEnumerable{TConnectTo}).
TAsElement
The type of the as field elements.
TAs
The type of the as field.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
from
IMongoCollection<TFrom>The from collection.
connectFromField
Expression<Func<TFrom, TConnectFrom>>The connect from field.
connectToField
Expression<Func<TFrom, TConnectTo>>The connect to field.
startWith
Expression<Func<TIntermediate, TStartWith>>The start with value.
as
Expression<Func<TOutput, TAs>>The as field.
depthField
Expression<Func<TAsElement, int>>The depth field.
options
AggregateGraphLookupOptions<TFrom, TAsElement, TOutput>The options.
translationOptions
ExpressionTranslationOptionsThe translation options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TFrom
The type of the from documents.
TConnectFrom
The type of the connect from field (must be either TConnectTo or a type that implements IEnumerable{TConnectTo}).
TConnectTo
The type of the connect to field.
TStartWith
The type of the start with expression (must be either TConnectTo or a type that implements IEnumerable{TConnectTo}).
TAsElement
The type of the as field elements.
TAs
The type of the as field.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
group
ProjectionDefinition<TIntermediate, BsonDocument>The group projection.
Returns
- PipelineDefinition<TInput, BsonDocument>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
group
ProjectionDefinition<TIntermediate, TOutput>The group projection.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
id
Expression<Func<TIntermediate, TKey>>The id.
group
Expression<Func<IGrouping<TKey, TIntermediate>, TOutput>>The group projection.
translationOptions
ExpressionTranslationOptionsThe translation options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TKey
The type of the key.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TOutput>The pipeline.
limit
longThe limit.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
foreignCollection
IMongoCollection<TForeignDocument>The foreign collection.
localField
FieldDefinition<TIntermediate>The local field.
foreignField
FieldDefinition<TForeignDocument>The foreign field.
as
FieldDefinition<TOutput>The "as" field.
options
AggregateLookupOptions<TForeignDocument, TOutput>The options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TForeignDocument
The type of the foreign collection documents.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
foreignCollection
IMongoCollection<TForeignDocument>The foreign collection.
localField
Expression<Func<TIntermediate, object>>The local field.
foreignField
Expression<Func<TForeignDocument, object>>The foreign field.
as
Expression<Func<TOutput, object>>The "as" field.
options
AggregateLookupOptions<TForeignDocument, TOutput>The options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TForeignDocument
The type of the foreign collection documents.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
foreignCollection
IMongoCollection<TForeignDocument>The foreign collection.
let
BsonDocumentThe "let" definition.
lookupPipeline
PipelineDefinition<TForeignDocument, TAsElement>The lookup pipeline.
as
FieldDefinition<TOutput, TAs>The as field in
TOutput
in which to place the results of the lookup pipeline.options
AggregateLookupOptions<TForeignDocument, TOutput>The options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TForeignDocument
The type of the foreign collection documents.
TAsElement
The type of the as field elements.
TAs
The type of the as field.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
foreignCollection
IMongoCollection<TForeignDocument>The foreign collection.
let
BsonDocumentThe "let" definition.
lookupPipeline
PipelineDefinition<TForeignDocument, TAsElement>The lookup pipeline.
as
Expression<Func<TOutput, TAs>>The as field in
TOutput
in which to place the results of the lookup pipeline.options
AggregateLookupOptions<TForeignDocument, TOutput>The options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TForeignDocument
The type of the foreign collection documents.
TAsElement
The type of the as field elements.
TAs
The type of the as field.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TOutput>The pipeline.
filter
FilterDefinition<TOutput>The filter.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TOutput>The pipeline.
filter
Expression<Func<TOutput, bool>>The filter.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
outputCollection
IMongoCollection<TOutput>The output collection.
mergeOptions
MergeStageOptions<TOutput>The merge options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
outputSerializer
IBsonSerializer<TOutput>The output serializer.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TOutput>The pipeline.
outputCollection
IMongoCollection<TOutput>The output collection.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
projection
ProjectionDefinition<TIntermediate, BsonDocument>The projection.
Returns
- PipelineDefinition<TInput, BsonDocument>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
projection
ProjectionDefinition<TIntermediate, TOutput>The projection.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
projection
Expression<Func<TIntermediate, TOutput>>The projection.
translationOptions
ExpressionTranslationOptionsThe translation options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
newRoot
AggregateExpressionDefinition<TIntermediate, TOutput>The new root.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
newRoot
Expression<Func<TIntermediate, TOutput>>The new root.
translationOptions
ExpressionTranslationOptionsThe translation options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
newRoot
AggregateExpressionDefinition<TIntermediate, TOutput>The new root.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
newRoot
Expression<Func<TIntermediate, TOutput>>The new root.
translationOptions
ExpressionTranslationOptionsThe translation options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TOutput>The pipeline.
query
SearchDefinition<TOutput>The search definition.
indexName
stringThe index name.
count
SearchCountOptionsThe count options.
Returns
- PipelineDefinition<TInput, SearchMetaResult>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TOutput>The pipeline.
searchDefinition
SearchDefinition<TOutput>The search definition.
highlight
SearchHighlightOptions<TOutput>The highlight options.
indexName
stringThe index name.
count
SearchCountOptionsThe count options.
returnStoredSource
boolFlag that specifies whether to perform a full document lookup on the backend database or return only stored source fields directly from Atlas Search.
scoreDetails
boolFlag 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
TInput
The type of the input documents.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TOutput>The pipeline.
searchDefinition
SearchDefinition<TOutput>The search definition.
searchOptions
SearchOptions<TOutput>The search options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
output
AggregateExpressionDefinition<ISetWindowFieldsPartition<TIntermediate>, TWindowFields>The window fields expression.
Returns
- PipelineDefinition<TInput, BsonDocument>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TWindowFields
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
partitionBy
AggregateExpressionDefinition<TIntermediate, TPartitionBy>The partitionBy expression.
output
AggregateExpressionDefinition<ISetWindowFieldsPartition<TIntermediate>, TWindowFields>The window fields expression.
Returns
- PipelineDefinition<TInput, BsonDocument>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TPartitionBy
The type of the value to partition by.
TWindowFields
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
partitionBy
AggregateExpressionDefinition<TIntermediate, TPartitionBy>The partitionBy expression.
sortBy
SortDefinition<TIntermediate>The sortBy expression.
output
AggregateExpressionDefinition<ISetWindowFieldsPartition<TIntermediate>, TWindowFields>The window fields expression.
Returns
- PipelineDefinition<TInput, BsonDocument>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TPartitionBy
The type of the value to partition by.
TWindowFields
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
output
Expression<Func<ISetWindowFieldsPartition<TIntermediate>, TWindowFields>>The window fields expression.
Returns
- PipelineDefinition<TInput, BsonDocument>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TPartitionBy
The type of the value to partition by.
TWindowFields
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
partitionBy
Expression<Func<TIntermediate, TPartitionBy>>The partitionBy expression.
sortBy
SortDefinition<TIntermediate>The sortBy expression.
output
Expression<Func<ISetWindowFieldsPartition<TIntermediate>, TWindowFields>>The window fields expression.
Returns
- PipelineDefinition<TInput, BsonDocument>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TPartitionBy
The type of the value to partition by.
TWindowFields
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
partitionBy
Expression<Func<TIntermediate, TPartitionBy>>The partitionBy expression.
output
Expression<Func<ISetWindowFieldsPartition<TIntermediate>, TWindowFields>>The window fields expression.
Returns
- PipelineDefinition<TInput, BsonDocument>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TPartitionBy
The type of the value to partition by.
TWindowFields
The 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
pipeline
PipelineDefinition<TInput, TOutput>The pipeline.
fields
SetFieldDefinitions<TOutput>The fields to set.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TOutput>The pipeline.
fields
Expression<Func<TOutput, TFields>>The fields to set.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TOutput
The type of the output documents.
TFields
The 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
pipeline
PipelineDefinition<TInput, TOutput>The pipeline.
skip
longThe number of documents to skip.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
value
AggregateExpressionDefinition<TIntermediate, TValue>The value expression.
Returns
- PipelineDefinition<TInput, AggregateSortByCountResult<TValue>>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TValue
The type of the values.
SortByCount<TInput, TIntermediate, TValue>(PipelineDefinition<TInput, TIntermediate>, Expression<Func<TIntermediate, TValue>>, ExpressionTranslationOptions)
Appends a sortByCount stage to the pipeline.
public static PipelineDefinition<TInput, AggregateSortByCountResult<TValue>> SortByCount<TInput, TIntermediate, TValue>(this PipelineDefinition<TInput, TIntermediate> pipeline, Expression<Func<TIntermediate, TValue>> value, ExpressionTranslationOptions translationOptions = null)
Parameters
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
value
Expression<Func<TIntermediate, TValue>>The value expression.
translationOptions
ExpressionTranslationOptionsThe translation options.
Returns
- PipelineDefinition<TInput, AggregateSortByCountResult<TValue>>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TValue
The type of the values.
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
pipeline
PipelineDefinition<TInput, TOutput>The pipeline.
sort
SortDefinition<TOutput>The sort definition.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TOutput>The pipeline.
withCollection
IMongoCollection<TWith>The with collection.
withPipeline
PipelineDefinition<TWith, TOutput>The with pipeline.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TWith
The type of the with collection documents.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
field
FieldDefinition<TIntermediate>The field to unwind.
options
AggregateUnwindOptions<BsonDocument>The options.
Returns
- PipelineDefinition<TInput, BsonDocument>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
field
Expression<Func<TIntermediate, object>>The field to unwind.
options
AggregateUnwindOptions<BsonDocument>The options.
Returns
- PipelineDefinition<TInput, BsonDocument>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
field
FieldDefinition<TIntermediate>The field.
options
AggregateUnwindOptions<TOutput>The options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TIntermediate>The pipeline.
field
Expression<Func<TIntermediate, object>>The field to unwind.
options
AggregateUnwindOptions<TOutput>The options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input documents.
TIntermediate
The type of the intermediate documents.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TOutput>The pipeline.
field
FieldDefinition<TOutput>The field.
queryVector
QueryVectorThe query vector.
limit
intThe limit.
options
VectorSearchOptions<TOutput>The vector search options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input.
TOutput
The 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
pipeline
PipelineDefinition<TInput, TOutput>The pipeline.
field
Expression<Func<TOutput, TField>>The field.
queryVector
QueryVectorThe query vector.
limit
intThe limit.
options
VectorSearchOptions<TOutput>The vector search options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInput
The type of the input.
TField
The type of the field.
TOutput
The type of the output.