Click or drag to resize

PipelineDefinitionBuilder.GraphLookup<TInput, TIntermediate, TFrom, TConnectFrom, TConnectTo, TStartWith, TAs, TOutput> Method (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.

Namespace:  MongoDB.Driver
Assembly:  MongoDB.Driver (in MongoDB.Driver.dll) Version: 2.21.0+5a9c3311e158910b88195f290e6d4b1b2715d2b2
Syntax
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 : Object, IEnumerable<TFrom>

Parameters

pipeline
Type: MongoDB.Driver.PipelineDefinition<TInput, TIntermediate>
The pipeline.
from
Type: MongoDB.Driver.IMongoCollection<TFrom>
The from collection.
connectFromField
Type: System.Linq.Expressions.Expression<Func<TFrom, TConnectFrom>>
The connect from field.
connectToField
Type: System.Linq.Expressions.Expression<Func<TFrom, TConnectTo>>
The connect to field.
startWith
Type: System.Linq.Expressions.Expression<Func<TIntermediate, TStartWith>>
The start with value.
as
Type: System.Linq.Expressions.Expression<Func<TOutput, TAs>>
The as field.
options (Optional)
Type: MongoDB.Driver.AggregateGraphLookupOptions<TFrom, TFrom, TOutput>
The options.
translationOptions (Optional)
Type: MongoDB.Driver.ExpressionTranslationOptions
The translation options.

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.

Return Value

Type: PipelineDefinition<TInput, TOutput>
The stage.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type PipelineDefinition<TInput, TIntermediate>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also