Method Lookup
| MongoDB CSharp Driver API Reference (original) (raw)
Namespace
Assembly
MongoDB.Driver.dll
Lookup<TInput, TForeignDocument, TOutput>(IMongoCollection, FieldDefinition, FieldDefinition, FieldDefinition, 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
foreignCollection IMongoCollection
The foreign collection.
localField FieldDefinition
The local field.
foreignField FieldDefinition
The foreign field.
The "as" field.
options AggregateLookupOptions<TForeignDocument, TOutput>
The options.
Returns
PipelineStageDefinition<TInput, TOutput>
The stage.
Type Parameters
TInput
The type of the input documents.
TForeignDocument
The type of the foreign collection documents.
TOutput
The type of the output documents.
Lookup<TInput, TForeignDocument, TOutput>(IMongoCollection, 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
foreignCollection IMongoCollection
The foreign collection.
localField Expression<Func<TInput, object>>
The local field.
foreignField Expression<Func<TForeignDocument, object>>
The foreign field.
as Expression<Func<TOutput, object>>
The "as" field.
options AggregateLookupOptions<TForeignDocument, TOutput>
The options.
Returns
PipelineStageDefinition<TInput, TOutput>
The stage.
Type Parameters
TInput
The type of the input documents.
TForeignDocument
The type of the foreign collection documents.
TOutput
The type of the output documents.
Lookup<TInput, TForeignDocument, TAsElement, TAs, TOutput>(IMongoCollection, 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
foreignCollection IMongoCollection
The foreign collection.
let BsonDocument
The "let" definition.
lookupPipeline PipelineDefinition<TForeignDocument, TAsElement>
The lookup pipeline.
as FieldDefinition<TOutput, TAs>
The as field in TOutput in which to place the results of the lookup pipeline.
options AggregateLookupOptions<TForeignDocument, TOutput>
The options.
Returns
PipelineStageDefinition<TInput, TOutput>
The stage.
Type Parameters
TInput
The type of the input documents.
TForeignDocument
The type of the foreign collection documents.
TAsElement
The type of the as field elements.
TAs
The type of the as field.
TOutput
The type of the output documents.
Lookup<TInput, TForeignDocument, TAsElement, TAs, TOutput>(IMongoCollection, 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
foreignCollection IMongoCollection
The foreign collection.
let BsonDocument
The "let" definition.
lookupPipeline PipelineDefinition<TForeignDocument, TAsElement>
The lookup pipeline.
as Expression<Func<TOutput, TAs>>
The as field in TOutput in which to place the results of the lookup pipeline.
options AggregateLookupOptions<TForeignDocument, TOutput>
The options.
Returns
PipelineStageDefinition<TInput, TOutput>
The stage.
Type Parameters
TInput
The type of the input documents.
TForeignDocument
The type of the foreign collection documents.
TAsElement
The type of the as field elements.
TAs
The type of the as field.
TOutput
The type of the output documents.