Method Lookup
Lookup<TInput, TForeignDocument, TOutput>(IMongoCollection<TForeignDocument>, FieldDefinition<TInput>, FieldDefinition<TForeignDocument>, FieldDefinition<TOutput>, AggregateLookupOptions<TForeignDocument, TOutput>)
Creates a $lookup stage.
public static PipelineStageDefinition<TInput, TOutput> Lookup<TInput, TForeignDocument, TOutput>(IMongoCollection<TForeignDocument> foreignCollection, FieldDefinition<TInput> localField, FieldDefinition<TForeignDocument> foreignField, FieldDefinition<TOutput> @as, AggregateLookupOptions<TForeignDocument, TOutput> options = null)
Parameters
foreignCollectionIMongoCollection<TForeignDocument>The foreign collection.
localFieldFieldDefinition<TInput>The local field.
foreignFieldFieldDefinition<TForeignDocument>The foreign field.
asFieldDefinition<TOutput>The "as" field.
optionsAggregateLookupOptions<TForeignDocument, TOutput>The options.
Returns
- PipelineStageDefinition<TInput, TOutput>
The stage.
Type Parameters
TInputThe type of the input documents.
TForeignDocumentThe type of the foreign collection documents.
TOutputThe type of the output documents.
Lookup<TInput, TForeignDocument, TOutput>(IMongoCollection<TForeignDocument>, Expression<Func<TInput, object>>, Expression<Func<TForeignDocument, object>>, Expression<Func<TOutput, object>>, AggregateLookupOptions<TForeignDocument, TOutput>)
Creates a $lookup stage.
public static PipelineStageDefinition<TInput, TOutput> Lookup<TInput, TForeignDocument, TOutput>(IMongoCollection<TForeignDocument> foreignCollection, Expression<Func<TInput, object>> localField, Expression<Func<TForeignDocument, object>> foreignField, Expression<Func<TOutput, object>> @as, AggregateLookupOptions<TForeignDocument, TOutput> options = null)
Parameters
foreignCollectionIMongoCollection<TForeignDocument>The foreign collection.
localFieldExpression<Func<TInput, object>>The local field.
foreignFieldExpression<Func<TForeignDocument, object>>The foreign field.
asExpression<Func<TOutput, object>>The "as" field.
optionsAggregateLookupOptions<TForeignDocument, TOutput>The options.
Returns
- PipelineStageDefinition<TInput, TOutput>
The stage.
Type Parameters
TInputThe type of the input documents.
TForeignDocumentThe type of the foreign collection documents.
TOutputThe type of the output documents.
Lookup<TInput, TForeignDocument, TAsElement, TAs, TOutput>(IMongoCollection<TForeignDocument>, BsonDocument, PipelineDefinition<TForeignDocument, TAsElement>, FieldDefinition<TOutput, TAs>, AggregateLookupOptions<TForeignDocument, TOutput>)
Creates a $lookup stage.
public static PipelineStageDefinition<TInput, TOutput> Lookup<TInput, TForeignDocument, TAsElement, TAs, TOutput>(IMongoCollection<TForeignDocument> foreignCollection, BsonDocument let, PipelineDefinition<TForeignDocument, TAsElement> lookupPipeline, FieldDefinition<TOutput, TAs> @as, AggregateLookupOptions<TForeignDocument, TOutput> options = null) where TAs : IEnumerable<TAsElement>
Parameters
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
- PipelineStageDefinition<TInput, TOutput>
The stage.
Type Parameters
TInputThe type of the input 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, TForeignDocument, TAsElement, TAs, TOutput>(IMongoCollection<TForeignDocument>, BsonDocument, PipelineDefinition<TForeignDocument, TAsElement>, Expression<Func<TOutput, TAs>>, AggregateLookupOptions<TForeignDocument, TOutput>)
Creates a $lookup stage.
public static PipelineStageDefinition<TInput, TOutput> Lookup<TInput, TForeignDocument, TAsElement, TAs, TOutput>(IMongoCollection<TForeignDocument> foreignCollection, BsonDocument let, PipelineDefinition<TForeignDocument, TAsElement> lookupPipeline, Expression<Func<TOutput, TAs>> @as, AggregateLookupOptions<TForeignDocument, TOutput> options = null) where TAs : IEnumerable<TAsElement>
Parameters
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
- PipelineStageDefinition<TInput, TOutput>
The stage.
Type Parameters
TInputThe type of the input 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.