Table of Contents

Method GraphLookup

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

GraphLookup<TResult, TFrom, TConnectFrom, TConnectTo, TStartWith, TAs, TNewResult>(IAggregateFluent<TResult>, IMongoCollection<TFrom>, FieldDefinition<TFrom, TConnectFrom>, FieldDefinition<TFrom, TConnectTo>, AggregateExpressionDefinition<TResult, TStartWith>, FieldDefinition<TNewResult, TAs>, AggregateGraphLookupOptions<TFrom, TFrom, TNewResult>)

Appends a $graphLookup stage to the pipeline.

public static IAggregateFluent<TNewResult> GraphLookup<TResult, TFrom, TConnectFrom, TConnectTo, TStartWith, TAs, TNewResult>(this IAggregateFluent<TResult> aggregate, IMongoCollection<TFrom> from, FieldDefinition<TFrom, TConnectFrom> connectFromField, FieldDefinition<TFrom, TConnectTo> connectToField, AggregateExpressionDefinition<TResult, TStartWith> startWith, FieldDefinition<TNewResult, TAs> @as, AggregateGraphLookupOptions<TFrom, TFrom, TNewResult> options = null) where TAs : IEnumerable<TFrom>

Parameters

aggregate IAggregateFluent<TResult>

The aggregate.

from IMongoCollection<TFrom>

The from collection.

connectFromField FieldDefinition<TFrom, TConnectFrom>

The connect from field.

connectToField FieldDefinition<TFrom, TConnectTo>

The connect to field.

startWith AggregateExpressionDefinition<TResult, TStartWith>

The start with value.

as FieldDefinition<TNewResult, TAs>

The as field.

options AggregateGraphLookupOptions<TFrom, TFrom, TNewResult>

The options.

Returns

IAggregateFluent<TNewResult>

The fluent aggregate interface.

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}).

TAs

The type of the as field.

TNewResult

The type of the new result (must be same as TResult with an additional as field).

GraphLookup<TResult, TFrom>(IAggregateFluent<TResult>, IMongoCollection<TFrom>, FieldDefinition<TFrom, BsonValue>, FieldDefinition<TFrom, BsonValue>, AggregateExpressionDefinition<TResult, BsonValue>, FieldDefinition<BsonDocument, IEnumerable<BsonDocument>>, FieldDefinition<BsonDocument, int>)

Appends a $graphLookup stage to the pipeline.

public static IAggregateFluent<BsonDocument> GraphLookup<TResult, TFrom>(this IAggregateFluent<TResult> aggregate, IMongoCollection<TFrom> from, FieldDefinition<TFrom, BsonValue> connectFromField, FieldDefinition<TFrom, BsonValue> connectToField, AggregateExpressionDefinition<TResult, BsonValue> startWith, FieldDefinition<BsonDocument, IEnumerable<BsonDocument>> @as, FieldDefinition<BsonDocument, int> depthField = null)

Parameters

aggregate IAggregateFluent<TResult>

The aggregate.

from IMongoCollection<TFrom>

The from collection.

connectFromField FieldDefinition<TFrom, BsonValue>

The connect from field.

connectToField FieldDefinition<TFrom, BsonValue>

The connect to field.

startWith AggregateExpressionDefinition<TResult, BsonValue>

The start with value.

as FieldDefinition<BsonDocument, IEnumerable<BsonDocument>>

The as field.

depthField FieldDefinition<BsonDocument, int>

The depth field.

Returns

IAggregateFluent<BsonDocument>

The fluent aggregate interface.

Type Parameters

TResult

The type of the result.

TFrom

The type of the from documents.

GraphLookup<TResult, TFrom, TConnectFrom, TConnectTo, TStartWith, TAs, TNewResult>(IAggregateFluent<TResult>, IMongoCollection<TFrom>, Expression<Func<TFrom, TConnectFrom>>, Expression<Func<TFrom, TConnectTo>>, Expression<Func<TResult, TStartWith>>, Expression<Func<TNewResult, TAs>>, AggregateGraphLookupOptions<TFrom, TFrom, TNewResult>)

Appends a $graphLookup stage to the pipeline.

public static IAggregateFluent<TNewResult> GraphLookup<TResult, TFrom, TConnectFrom, TConnectTo, TStartWith, 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, AggregateGraphLookupOptions<TFrom, TFrom, TNewResult> options = null) where TAs : IEnumerable<TFrom>

Parameters

aggregate IAggregateFluent<TResult>

The aggregate.

from IMongoCollection<TFrom>

The from collection.

connectFromField Expression<Func<TFrom, TConnectFrom>>

The connect from field.

connectToField Expression<Func<TFrom, TConnectTo>>

The connect to field.

startWith Expression<Func<TResult, TStartWith>>

The start with value.

as Expression<Func<TNewResult, TAs>>

The as field.

options AggregateGraphLookupOptions<TFrom, TFrom, TNewResult>

The options.

Returns

IAggregateFluent<TNewResult>

The fluent aggregate interface.

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}).

TAs

The type of the as field.

TNewResult

The type of the new result (must be same as TResult with an additional as field).

GraphLookup<TResult, TFrom, TConnectFrom, TConnectTo, TStartWith, TAsElement, TAs, TNewResult>(IAggregateFluent<TResult>, IMongoCollection<TFrom>, Expression<Func<TFrom, TConnectFrom>>, Expression<Func<TFrom, TConnectTo>>, Expression<Func<TResult, TStartWith>>, Expression<Func<TNewResult, TAs>>, Expression<Func<TAsElement, int>>, AggregateGraphLookupOptions<TFrom, TAsElement, TNewResult>)

Appends a $graphLookup stage to the pipeline.

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 : IEnumerable<TAsElement>

Parameters

aggregate IAggregateFluent<TResult>

The aggregate.

from IMongoCollection<TFrom>

The from collection.

connectFromField Expression<Func<TFrom, TConnectFrom>>

The connect from field.

connectToField Expression<Func<TFrom, TConnectTo>>

The connect to field.

startWith Expression<Func<TResult, TStartWith>>

The start with value.

as Expression<Func<TNewResult, TAs>>

The as field.

depthField Expression<Func<TAsElement, int>>

The depth field.

options AggregateGraphLookupOptions<TFrom, TAsElement, TNewResult>

The options.

Returns

IAggregateFluent<TNewResult>

The fluent aggregate interface.

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).