Table of Contents

Class PipelineStageDefinitionBuilder

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

Methods for building pipeline stages.

public static class PipelineStageDefinitionBuilder
Inheritance
PipelineStageDefinitionBuilder
Inherited Members

Methods

BucketAutoForLinq2<TInput, TValue, TOutput>(Expression<Func<TInput, TValue>>, int, Expression<Func<IGrouping<TValue, TInput>, TOutput>>, AggregateBucketAutoOptions, ExpressionTranslationOptions)

Creates a $bucketAuto stage (this method can only be used with LINQ2).

BucketAuto<TInput, TValue>(AggregateExpressionDefinition<TInput, TValue>, int, AggregateBucketAutoOptions)

Creates a $bucketAuto stage.

BucketAuto<TInput, TValue>(Expression<Func<TInput, TValue>>, int, AggregateBucketAutoOptions, ExpressionTranslationOptions)

Creates a $bucketAuto stage.

BucketAuto<TInput, TValue, TOutput>(AggregateExpressionDefinition<TInput, TValue>, int, ProjectionDefinition<TInput, TOutput>, AggregateBucketAutoOptions)

Creates a $bucketAuto stage.

BucketAuto<TInput, TValue, TOutput>(Expression<Func<TInput, TValue>>, int, Expression<Func<IGrouping<AggregateBucketAutoResultId<TValue>, TInput>, TOutput>>, AggregateBucketAutoOptions, ExpressionTranslationOptions)

Creates a $bucketAuto stage (this overload can only be used with LINQ3).

Bucket<TInput, TValue>(AggregateExpressionDefinition<TInput, TValue>, IEnumerable<TValue>, AggregateBucketOptions<TValue>)

Creates a $bucket stage.

Bucket<TInput, TValue>(Expression<Func<TInput, TValue>>, IEnumerable<TValue>, AggregateBucketOptions<TValue>, ExpressionTranslationOptions)

Creates a $bucket stage.

Bucket<TInput, TValue, TOutput>(AggregateExpressionDefinition<TInput, TValue>, IEnumerable<TValue>, ProjectionDefinition<TInput, TOutput>, AggregateBucketOptions<TValue>)

Creates a $bucket stage.

Bucket<TInput, TValue, TOutput>(Expression<Func<TInput, TValue>>, IEnumerable<TValue>, Expression<Func<IGrouping<TValue, TInput>, TOutput>>, AggregateBucketOptions<TValue>, ExpressionTranslationOptions)

Creates a $bucket stage.

ChangeStreamSplitLargeEvent<TInput>()

Creates a $changeStreamSplitLargeEvent stage.

ChangeStream<TInput>(ChangeStreamStageOptions)

Creates a $changeStream stage. Normally you would prefer to use the Watch method of IMongoCollection<TDocument>. Only use this method if subsequent stages project away the resume token (the _id) or you don't want the resulting cursor to automatically resume.

Count<TInput>()

Creates a $count stage.

Densify<TInput>(FieldDefinition<TInput>, DensifyRange, params FieldDefinition<TInput>[])

Creates a $densify stage.

Densify<TInput>(FieldDefinition<TInput>, DensifyRange, IEnumerable<FieldDefinition<TInput>>)

Creates a $densify stage.

Densify<TInput>(Expression<Func<TInput, object>>, DensifyRange, IEnumerable<Expression<Func<TInput, object>>>)

Creates a $densify stage.

Densify<TInput>(Expression<Func<TInput, object>>, DensifyRange, params Expression<Func<TInput, object>>[])

Creates a $densify stage.

Documents<TDocument>(AggregateExpressionDefinition<NoPipelineInput, IEnumerable<TDocument>>, IBsonSerializer<TDocument>)

Creates a $documents stage.

Documents<TDocument>(IEnumerable<TDocument>, IBsonSerializer<TDocument>)

Creates a $documents stage.

Facet<TInput>(params AggregateFacet<TInput>[])

Creates a $facet stage.

Facet<TInput>(IEnumerable<AggregateFacet<TInput>>)

Creates a $facet stage.

Facet<TInput, TOutput>(params AggregateFacet<TInput>[])

Creates a $facet stage.

Facet<TInput, TOutput>(IEnumerable<AggregateFacet<TInput>>, AggregateFacetOptions<TOutput>)

Creates a $facet stage.

GraphLookup<TInput, TFrom>(IMongoCollection<TFrom>, FieldDefinition<TFrom, BsonValue>, FieldDefinition<TFrom, BsonValue>, AggregateExpressionDefinition<TInput, BsonValue>, FieldDefinition<BsonDocument, IEnumerable<BsonDocument>>, FieldDefinition<BsonDocument, int>)

Creates a $graphLookup stage.

GraphLookup<TInput, TFrom, TConnectFrom, TConnectTo, TStartWith, TAs, TOutput>(IMongoCollection<TFrom>, FieldDefinition<TFrom, TConnectFrom>, FieldDefinition<TFrom, TConnectTo>, AggregateExpressionDefinition<TInput, TStartWith>, FieldDefinition<TOutput, TAs>, AggregateGraphLookupOptions<TFrom, TFrom, TOutput>)

Creates a $graphLookup stage.

GraphLookup<TInput, TFrom, TConnectFrom, TConnectTo, TStartWith, TAs, TOutput>(IMongoCollection<TFrom>, Expression<Func<TFrom, TConnectFrom>>, Expression<Func<TFrom, TConnectTo>>, Expression<Func<TInput, TStartWith>>, Expression<Func<TOutput, TAs>>, AggregateGraphLookupOptions<TFrom, TFrom, TOutput>, ExpressionTranslationOptions)

Creates a $graphLookup stage.

GraphLookup<TInput, TFrom, TConnectFrom, TConnectTo, TStartWith, TAsElement, TAs, TOutput>(IMongoCollection<TFrom>, FieldDefinition<TFrom, TConnectFrom>, FieldDefinition<TFrom, TConnectTo>, AggregateExpressionDefinition<TInput, TStartWith>, FieldDefinition<TOutput, TAs>, FieldDefinition<TAsElement, int>, AggregateGraphLookupOptions<TFrom, TAsElement, TOutput>)

Creates a $graphLookup stage.

GraphLookup<TInput, TFrom, TConnectFrom, TConnectTo, TStartWith, TAsElement, TAs, TOutput>(IMongoCollection<TFrom>, Expression<Func<TFrom, TConnectFrom>>, Expression<Func<TFrom, TConnectTo>>, Expression<Func<TInput, TStartWith>>, Expression<Func<TOutput, TAs>>, Expression<Func<TAsElement, int>>, AggregateGraphLookupOptions<TFrom, TAsElement, TOutput>, ExpressionTranslationOptions)

Creates a $graphLookup stage.

Group<TInput>(ProjectionDefinition<TInput, BsonDocument>)

Creates a $group stage.

Group<TInput, TOutput>(ProjectionDefinition<TInput, TOutput>)

Creates a $group stage.

Group<TInput, TValue, TOutput>(Expression<Func<TInput, TValue>>, Expression<Func<IGrouping<TValue, TInput>, TOutput>>, ExpressionTranslationOptions)

Creates a $group stage (this method can only be used with LINQ2).

Limit<TInput>(long)

Creates a $limit stage.

Lookup<TInput, TForeignDocument, TOutput>(IMongoCollection<TForeignDocument>, FieldDefinition<TInput>, FieldDefinition<TForeignDocument>, FieldDefinition<TOutput>, AggregateLookupOptions<TForeignDocument, TOutput>)

Creates a $lookup stage.

Lookup<TInput, TForeignDocument, TOutput>(IMongoCollection<TForeignDocument>, Expression<Func<TInput, object>>, Expression<Func<TForeignDocument, object>>, Expression<Func<TOutput, object>>, AggregateLookupOptions<TForeignDocument, TOutput>)

Creates a $lookup stage.

Lookup<TInput, TForeignDocument, TAsElement, TAs, TOutput>(IMongoCollection<TForeignDocument>, BsonDocument, PipelineDefinition<TForeignDocument, TAsElement>, FieldDefinition<TOutput, TAs>, AggregateLookupOptions<TForeignDocument, TOutput>)

Creates a $lookup stage.

Lookup<TInput, TForeignDocument, TAsElement, TAs, TOutput>(IMongoCollection<TForeignDocument>, BsonDocument, PipelineDefinition<TForeignDocument, TAsElement>, Expression<Func<TOutput, TAs>>, AggregateLookupOptions<TForeignDocument, TOutput>)

Creates a $lookup stage.

Match<TInput>(FilterDefinition<TInput>)

Creates a $match stage.

Match<TInput>(Expression<Func<TInput, bool>>)

Creates a $match stage.

Merge<TInput, TOutput>(IMongoCollection<TOutput>, MergeStageOptions<TOutput>)

Creates a $merge stage.

OfType<TInput, TOutput>(IBsonSerializer<TOutput>)

Create a $match stage that select documents of a sub type.

Out<TInput>(IMongoCollection<TInput>, TimeSeriesOptions)

Creates a $out stage.

Project<TInput>(ProjectionDefinition<TInput, BsonDocument>)

Creates a $project stage.

Project<TInput, TOutput>(ProjectionDefinition<TInput, TOutput>)

Creates a $project stage.

Project<TInput, TOutput>(Expression<Func<TInput, TOutput>>, ExpressionTranslationOptions)

Creates a $project stage.

ReplaceRoot<TInput, TOutput>(AggregateExpressionDefinition<TInput, TOutput>)

Creates a $replaceRoot stage.

ReplaceRoot<TInput, TOutput>(Expression<Func<TInput, TOutput>>, ExpressionTranslationOptions)

Creates a $replaceRoot stage.

ReplaceWith<TInput, TOutput>(AggregateExpressionDefinition<TInput, TOutput>)

Creates a $replaceWith stage.

ReplaceWith<TInput, TOutput>(Expression<Func<TInput, TOutput>>, ExpressionTranslationOptions)

Creates a $replaceWith stage.

Sample<TInput>(long)

Creates a $sample stage.

SearchMeta<TInput>(SearchDefinition<TInput>, string, SearchCountOptions)

Creates a $searchMeta stage.

Search<TInput>(SearchDefinition<TInput>, SearchHighlightOptions<TInput>, string, SearchCountOptions, bool, bool)

Creates a $search stage.

Search<TInput>(SearchDefinition<TInput>, SearchOptions<TInput>)

Creates a $search stage.

SetWindowFields<TInput, TWindowFields>(AggregateExpressionDefinition<ISetWindowFieldsPartition<TInput>, TWindowFields>)

Create a $setWindowFields stage.

SetWindowFields<TInput, TWindowFields>(Expression<Func<ISetWindowFieldsPartition<TInput>, TWindowFields>>, ExpressionTranslationOptions)

Create a $setWindowFields stage.

SetWindowFields<TInput, TPartitionBy, TWindowFields>(AggregateExpressionDefinition<TInput, TPartitionBy>, AggregateExpressionDefinition<ISetWindowFieldsPartition<TInput>, TWindowFields>)

Create a $setWindowFields stage.

SetWindowFields<TInput, TPartitionBy, TWindowFields>(AggregateExpressionDefinition<TInput, TPartitionBy>, SortDefinition<TInput>, AggregateExpressionDefinition<ISetWindowFieldsPartition<TInput>, TWindowFields>)

Create a $setWindowFields stage.

SetWindowFields<TInput, TPartitionBy, TWindowFields>(Expression<Func<TInput, TPartitionBy>>, SortDefinition<TInput>, Expression<Func<ISetWindowFieldsPartition<TInput>, TWindowFields>>, ExpressionTranslationOptions)

Create a $setWindowFields stage.

SetWindowFields<TInput, TPartitionBy, TWindowFields>(Expression<Func<TInput, TPartitionBy>>, Expression<Func<ISetWindowFieldsPartition<TInput>, TWindowFields>>, ExpressionTranslationOptions)

Create a $setWindowFields stage.

Set<TInput>(SetFieldDefinitions<TInput>)

Creates a $set stage.

Set<TInput, TFields>(Expression<Func<TInput, TFields>>)

Creates a $set stage.

Skip<TInput>(long)

Creates a $skip stage.

SortByCount<TInput, TValue>(AggregateExpressionDefinition<TInput, TValue>)

Creates a $sortByCount stage.

SortByCount<TInput, TValue>(Expression<Func<TInput, TValue>>, ExpressionTranslationOptions)

Creates a $sortByCount stage.

Sort<TInput>(SortDefinition<TInput>)

Creates a $sort stage.

UnionWith<TInput, TWith>(IMongoCollection<TWith>, PipelineDefinition<TWith, TInput>)

Creates a $unionWith stage.

Unwind<TInput>(FieldDefinition<TInput>, AggregateUnwindOptions<BsonDocument>)

Creates an $unwind stage.

Unwind<TInput>(Expression<Func<TInput, object>>, AggregateUnwindOptions<BsonDocument>)

Creates an $unwind stage.

Unwind<TInput, TOutput>(FieldDefinition<TInput>, AggregateUnwindOptions<TOutput>)

Creates an $unwind stage.

Unwind<TInput, TOutput>(Expression<Func<TInput, object>>, AggregateUnwindOptions<TOutput>)

Creates an $unwind stage.

VectorSearch<TInput>(FieldDefinition<TInput>, QueryVector, int, VectorSearchOptions<TInput>)

Creates a $vectorSearch stage.

VectorSearch<TInput, TField>(Expression<Func<TInput, TField>>, QueryVector, int, VectorSearchOptions<TInput>)

Creates a $vectorSearch stage.