Method GraphLookup
GraphLookup<TFrom, TConnectFrom, TConnectTo, TStartWith, TAsElement, TAs, TNewResult>(IMongoCollection<TFrom>, FieldDefinition<TFrom, TConnectFrom>, FieldDefinition<TFrom, TConnectTo>, AggregateExpressionDefinition<TResult, TStartWith>, FieldDefinition<TNewResult, TAs>, FieldDefinition<TAsElement, int>, AggregateGraphLookupOptions<TFrom, TAsElement, TNewResult>)
Appends a $graphLookup stage to the pipeline.
IAggregateFluent<TNewResult> GraphLookup<TFrom, TConnectFrom, TConnectTo, TStartWith, TAsElement, TAs, TNewResult>(IMongoCollection<TFrom> from, FieldDefinition<TFrom, TConnectFrom> connectFromField, FieldDefinition<TFrom, TConnectTo> connectToField, AggregateExpressionDefinition<TResult, TStartWith> startWith, FieldDefinition<TNewResult, TAs> @as, FieldDefinition<TAsElement, int> depthField, AggregateGraphLookupOptions<TFrom, TAsElement, TNewResult> options = null) where TAs : IEnumerable<TAsElement>
Parameters
fromIMongoCollection<TFrom>The from collection.
connectFromFieldFieldDefinition<TFrom, TConnectFrom>The connect from field.
connectToFieldFieldDefinition<TFrom, TConnectTo>The connect to field.
startWithAggregateExpressionDefinition<TResult, TStartWith>The start with value.
asFieldDefinition<TNewResult, TAs>The as field.
depthFieldFieldDefinition<TAsElement, int>The depth field.
optionsAggregateGraphLookupOptions<TFrom, TAsElement, TNewResult>The options.
Returns
- IAggregateFluent<TNewResult>
The fluent aggregate interface.
Type Parameters
TFromThe type of the from documents.
TConnectFromThe type of the connect from field (must be either TConnectTo or a type that implements IEnumerable{TConnectTo}).
TConnectToThe type of the connect to field.
TStartWithThe type of the start with expression (must be either TConnectTo or a type that implements IEnumerable{TConnectTo}).
TAsElementThe type of the as field elements.
TAsThe type of the as field.
TNewResultThe type of the new result (must be same as TResult with an additional as field).