PipelineDefinitionBuilder.GraphLookup<TInput, TIntermediate, TFrom, TConnectFrom, TConnectTo, TStartWith, TAs, TOutput> Method (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.
Namespace:
MongoDB.Driver
Assembly:
MongoDB.Driver (in MongoDB.Driver.dll) Version: 2.21.0+5a9c3311e158910b88195f290e6d4b1b2715d2b2
Syntaxpublic 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 : Object, IEnumerable<TFrom>
<ExtensionAttribute>
Public Shared Function GraphLookup(Of TInput, TIntermediate, TFrom, TConnectFrom, TConnectTo, TStartWith, TAs As {Object, IEnumerable(Of TFrom)}, TOutput) (
pipeline As PipelineDefinition(Of TInput, TIntermediate),
from As IMongoCollection(Of TFrom),
connectFromField As FieldDefinition(Of TFrom, TConnectFrom),
connectToField As FieldDefinition(Of TFrom, TConnectTo),
startWith As AggregateExpressionDefinition(Of TIntermediate, TStartWith),
as As FieldDefinition(Of TOutput, TAs),
Optional options As AggregateGraphLookupOptions(Of TFrom, TFrom, TOutput) = Nothing
) As PipelineDefinition(Of TInput, TOutput)
[<ExtensionAttribute>]
static member GraphLookup :
pipeline : PipelineDefinition<'TInput, 'TIntermediate> *
from : IMongoCollection<'TFrom> *
connectFromField : FieldDefinition<'TFrom, 'TConnectFrom> *
connectToField : FieldDefinition<'TFrom, 'TConnectTo> *
startWith : AggregateExpressionDefinition<'TIntermediate, 'TStartWith> *
as : FieldDefinition<'TOutput, 'TAs> *
?options : AggregateGraphLookupOptions<'TFrom, 'TFrom, 'TOutput>
(* Defaults:
let _options = defaultArg options null
*)
-> PipelineDefinition<'TInput, 'TOutput> when 'TAs : Object and IEnumerable<'TFrom>
Parameters
- pipeline
- Type: MongoDB.Driver.PipelineDefinition<TInput, TIntermediate>
The pipeline. - from
- Type: MongoDB.Driver.IMongoCollection<TFrom>
The from collection. - connectFromField
- Type: MongoDB.Driver.FieldDefinition<TFrom, TConnectFrom>
The connect from field. - connectToField
- Type: MongoDB.Driver.FieldDefinition<TFrom, TConnectTo>
The connect to field. - startWith
- Type: MongoDB.Driver.AggregateExpressionDefinition<TIntermediate, TStartWith>
The start with value. - as
- Type: MongoDB.Driver.FieldDefinition<TOutput, TAs>
The as field. - options (Optional)
- Type: MongoDB.Driver.AggregateGraphLookupOptions<TFrom, TFrom, 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}).
- 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