Table of Contents

Method GraphLookup

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

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, 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>(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>, 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 ExpressionTranslationOptions

The 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>, 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 ExpressionTranslationOptions

The 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.