Click or drag to resize

PipelineDefinitionBuilderGraphLookupTInput, TIntermediate, TFrom, TConnectFrom, TConnectTo, TStartWith, TAsElement, TAs, TOutput Method (PipelineDefinitionTInput, TIntermediate, IMongoCollectionTFrom, FieldDefinitionTFrom, TConnectFrom, FieldDefinitionTFrom, TConnectTo, AggregateExpressionDefinitionTIntermediate, TStartWith, FieldDefinitionTOutput, TAs, FieldDefinitionTAsElement, Int32, AggregateGraphLookupOptionsTFrom, TAsElement, TOutput)

Appends a $graphLookup stage to the pipeline.

Namespace:  MongoDB.Driver
Assembly:  MongoDB.Driver (in MongoDB.Driver.dll) Version: 2.20.0+ee01960089f28ea1b501690df5fc9f6318a70242
Syntax
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 : Object, IEnumerable<TAsElement>

Parameters

pipeline
Type: MongoDB.DriverPipelineDefinitionTInput, TIntermediate
The pipeline.
from
Type: MongoDB.DriverIMongoCollectionTFrom
The from collection.
connectFromField
Type: MongoDB.DriverFieldDefinitionTFrom, TConnectFrom
The connect from field.
connectToField
Type: MongoDB.DriverFieldDefinitionTFrom, TConnectTo
The connect to field.
startWith
Type: MongoDB.DriverAggregateExpressionDefinitionTIntermediate, TStartWith
The start with value.
as
Type: MongoDB.DriverFieldDefinitionTOutput, TAs
The as field.
depthField
Type: MongoDB.DriverFieldDefinitionTAsElement, Int32
The depth field.
options (Optional)
Type: MongoDB.DriverAggregateGraphLookupOptionsTFrom, TAsElement, TOutput
The 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}).
TAsElement
The type of the as field elements.
TAs
The type of the as field.
TOutput
The type of the output documents.

Return Value

Type: PipelineDefinitionTInput, TOutput
The fluent aggregate interface.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type PipelineDefinitionTInput, 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