Click or drag to resize

IAggregateFluentExtensions.GraphLookup<TResult, TFrom, TConnectFrom, TConnectTo, TStartWith, TAsElement, TAs, TNewResult> Method (IAggregateFluent<TResult>, IMongoCollection<TFrom>, Expression<Func<TFrom, TConnectFrom>>, Expression<Func<TFrom, TConnectTo>>, Expression<Func<TResult, TStartWith>>, Expression<Func<TNewResult, TAs>>, Expression<Func<TAsElement, Int32>>, AggregateGraphLookupOptions<TFrom, TAsElement, TNewResult>)

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 IAggregateFluent<TNewResult> GraphLookup<TResult, TFrom, TConnectFrom, TConnectTo, TStartWith, TAsElement, TAs, TNewResult>(
	this IAggregateFluent<TResult> aggregate,
	IMongoCollection<TFrom> from,
	Expression<Func<TFrom, TConnectFrom>> connectFromField,
	Expression<Func<TFrom, TConnectTo>> connectToField,
	Expression<Func<TResult, TStartWith>> startWith,
	Expression<Func<TNewResult, TAs>> as,
	Expression<Func<TAsElement, int>> depthField,
	AggregateGraphLookupOptions<TFrom, TAsElement, TNewResult> options = null
)
where TAs : Object, IEnumerable<TAsElement>

Parameters

aggregate
Type: MongoDB.Driver.IAggregateFluent<TResult>
The aggregate.
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<TResult, TStartWith>>
The start with value.
as
Type: System.Linq.Expressions.Expression<Func<TNewResult, TAs>>
The as field.
depthField
Type: System.Linq.Expressions.Expression<Func<TAsElement, Int32>>
The depth field.
options (Optional)
Type: MongoDB.Driver.AggregateGraphLookupOptions<TFrom, TAsElement, TNewResult>
The options.

Type Parameters

TResult
The type of the result.
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.
TNewResult
The type of the new result (must be same as TResult with an additional as field).

Return Value

Type: IAggregateFluent<TNewResult>
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 IAggregateFluent<TResult>. 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