Method Lookup
Lookup<TInput, TIntermediate, TForeignDocument, TOutput>(PipelineDefinition<TInput, TIntermediate>, IMongoCollection<TForeignDocument>, FieldDefinition<TIntermediate>, FieldDefinition<TForeignDocument>, FieldDefinition<TOutput>, AggregateLookupOptions<TForeignDocument, TOutput>)
Appends a $lookup stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> Lookup<TInput, TIntermediate, TForeignDocument, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, IMongoCollection<TForeignDocument> foreignCollection, FieldDefinition<TIntermediate> localField, FieldDefinition<TForeignDocument> foreignField, FieldDefinition<TOutput> @as, AggregateLookupOptions<TForeignDocument, TOutput> options = null)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
foreignCollectionIMongoCollection<TForeignDocument>The foreign collection.
localFieldFieldDefinition<TIntermediate>The local field.
foreignFieldFieldDefinition<TForeignDocument>The foreign field.
asFieldDefinition<TOutput>The "as" field.
optionsAggregateLookupOptions<TForeignDocument, TOutput>The options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TForeignDocumentThe type of the foreign collection documents.
TOutputThe type of the output documents.
Lookup<TInput, TIntermediate, TForeignDocument, TOutput>(PipelineDefinition<TInput, TIntermediate>, IMongoCollection<TForeignDocument>, Expression<Func<TIntermediate, object>>, Expression<Func<TForeignDocument, object>>, Expression<Func<TOutput, object>>, AggregateLookupOptions<TForeignDocument, TOutput>)
Appends a lookup stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> Lookup<TInput, TIntermediate, TForeignDocument, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, IMongoCollection<TForeignDocument> foreignCollection, Expression<Func<TIntermediate, object>> localField, Expression<Func<TForeignDocument, object>> foreignField, Expression<Func<TOutput, object>> @as, AggregateLookupOptions<TForeignDocument, TOutput> options = null)
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
foreignCollectionIMongoCollection<TForeignDocument>The foreign collection.
localFieldExpression<Func<TIntermediate, object>>The local field.
foreignFieldExpression<Func<TForeignDocument, object>>The foreign field.
asExpression<Func<TOutput, object>>The "as" field.
optionsAggregateLookupOptions<TForeignDocument, TOutput>The options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TForeignDocumentThe type of the foreign collection documents.
TOutputThe type of the output documents.
Lookup<TInput, TIntermediate, TForeignDocument, TAsElement, TAs, TOutput>(PipelineDefinition<TInput, TIntermediate>, IMongoCollection<TForeignDocument>, BsonDocument, PipelineDefinition<TForeignDocument, TAsElement>, FieldDefinition<TOutput, TAs>, AggregateLookupOptions<TForeignDocument, TOutput>)
Appends a $lookup stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> Lookup<TInput, TIntermediate, TForeignDocument, TAsElement, TAs, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, IMongoCollection<TForeignDocument> foreignCollection, BsonDocument let, PipelineDefinition<TForeignDocument, TAsElement> lookupPipeline, FieldDefinition<TOutput, TAs> @as, AggregateLookupOptions<TForeignDocument, TOutput> options = null) where TAs : IEnumerable<TAsElement>
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
foreignCollectionIMongoCollection<TForeignDocument>The foreign collection.
letBsonDocumentThe "let" definition.
lookupPipelinePipelineDefinition<TForeignDocument, TAsElement>The lookup pipeline.
asFieldDefinition<TOutput, TAs>The as field in
TOutputin which to place the results of the lookup pipeline.optionsAggregateLookupOptions<TForeignDocument, TOutput>The options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TForeignDocumentThe type of the foreign collection documents.
TAsElementThe type of the as field elements.
TAsThe type of the as field.
TOutputThe type of the output documents.
Lookup<TInput, TIntermediate, TForeignDocument, TAsElement, TAs, TOutput>(PipelineDefinition<TInput, TIntermediate>, IMongoCollection<TForeignDocument>, BsonDocument, PipelineDefinition<TForeignDocument, TAsElement>, Expression<Func<TOutput, TAs>>, AggregateLookupOptions<TForeignDocument, TOutput>)
Appends a $lookup stage to the pipeline.
public static PipelineDefinition<TInput, TOutput> Lookup<TInput, TIntermediate, TForeignDocument, TAsElement, TAs, TOutput>(this PipelineDefinition<TInput, TIntermediate> pipeline, IMongoCollection<TForeignDocument> foreignCollection, BsonDocument let, PipelineDefinition<TForeignDocument, TAsElement> lookupPipeline, Expression<Func<TOutput, TAs>> @as, AggregateLookupOptions<TForeignDocument, TOutput> options = null) where TAs : IEnumerable<TAsElement>
Parameters
pipelinePipelineDefinition<TInput, TIntermediate>The pipeline.
foreignCollectionIMongoCollection<TForeignDocument>The foreign collection.
letBsonDocumentThe "let" definition.
lookupPipelinePipelineDefinition<TForeignDocument, TAsElement>The lookup pipeline.
asExpression<Func<TOutput, TAs>>The as field in
TOutputin which to place the results of the lookup pipeline.optionsAggregateLookupOptions<TForeignDocument, TOutput>The options.
Returns
- PipelineDefinition<TInput, TOutput>
A new pipeline with an additional stage.
Type Parameters
TInputThe type of the input documents.
TIntermediateThe type of the intermediate documents.
TForeignDocumentThe type of the foreign collection documents.
TAsElementThe type of the as field elements.
TAsThe type of the as field.
TOutputThe type of the output documents.