Method Lookup
Lookup<TForeignDocument, TNewResult>(string, FieldDefinition<TResult>, FieldDefinition<TForeignDocument>, FieldDefinition<TNewResult>, AggregateLookupOptions<TForeignDocument, TNewResult>)
Appends a lookup stage to the pipeline.
IAggregateFluent<TNewResult> Lookup<TForeignDocument, TNewResult>(string foreignCollectionName, FieldDefinition<TResult> localField, FieldDefinition<TForeignDocument> foreignField, FieldDefinition<TNewResult> @as, AggregateLookupOptions<TForeignDocument, TNewResult> options = null)
Parameters
foreignCollectionNamestringName of the other collection.
localFieldFieldDefinition<TResult>The local field.
foreignFieldFieldDefinition<TForeignDocument>The foreign field.
asFieldDefinition<TNewResult>The field in
TNewResultto place the foreign results.optionsAggregateLookupOptions<TForeignDocument, TNewResult>The options.
Returns
- IAggregateFluent<TNewResult>
The fluent aggregate interface.
Type Parameters
TForeignDocumentThe type of the foreign document.
TNewResultThe type of the new result.
Lookup<TForeignDocument, TAsElement, TAs, TNewResult>(IMongoCollection<TForeignDocument>, BsonDocument, PipelineDefinition<TForeignDocument, TAsElement>, FieldDefinition<TNewResult, TAs>, AggregateLookupOptions<TForeignDocument, TNewResult>)
Appends a lookup stage to the pipeline.
IAggregateFluent<TNewResult> Lookup<TForeignDocument, TAsElement, TAs, TNewResult>(IMongoCollection<TForeignDocument> foreignCollection, BsonDocument let, PipelineDefinition<TForeignDocument, TAsElement> lookupPipeline, FieldDefinition<TNewResult, TAs> @as, AggregateLookupOptions<TForeignDocument, TNewResult> options = null) where TAs : IEnumerable<TAsElement>
Parameters
foreignCollectionIMongoCollection<TForeignDocument>The foreign collection.
letBsonDocumentThe "let" definition.
lookupPipelinePipelineDefinition<TForeignDocument, TAsElement>The lookup pipeline.
asFieldDefinition<TNewResult, TAs>The as field in
TNewResultin which to place the results of the lookup pipeline.optionsAggregateLookupOptions<TForeignDocument, TNewResult>The options.
Returns
- IAggregateFluent<TNewResult>
The fluent aggregate interface.
Type Parameters
TForeignDocumentThe type of the foreign collection documents.
TAsElementThe type of the as field elements.
TAsThe type of the as field.
TNewResultThe type of the new result.