Method Lookup
| MongoDB CSharp Driver API Reference (original) (raw)
Namespace
Assembly
MongoDB.Driver.dll
Lookup<TSource, TForeign, TField>(IQueryable, IMongoCollection, Expression<Func<TSource, TField>>, Expression<Func<TForeign, TField>>)
Looks up documents in a foreign collection.
public static IQueryable<LookupResult<TSource, TForeign>> Lookup<TSource, TForeign, TField>(this IQueryable<TSource> source, IMongoCollection<TForeign> from, Expression<Func<TSource, TField>> localField, Expression<Func<TForeign, TField>> foreignField)
Parameters
source
IQueryable
The source documents.
from
IMongoCollection
The foreign collection.
localField
Expression<Func<TSource, TField>>
The local field to compare against the foreign field.
foreignField
Expression<Func<TForeign, TField>>
The foreign field to compare against the local field.
Returns
IQueryable<LookupResult<TSource, TForeign>>
An IQueryable{LookupResult{TSource,TForeign}} with the results of the Lookup.
Type Parameters
TSource
The type of the source documents.
TForeign
The type of the foreign documents.
TField
The type of the fields being compared.
Lookup<TSource, TForeign, TResult>(IQueryable, IMongoCollection, Expression<Func<TSource, IQueryable, IQueryable>>)
Looks up documents in a foreign collection.
public static IQueryable<LookupResult<TSource, TResult>> Lookup<TSource, TForeign, TResult>(this IQueryable<TSource> source, IMongoCollection<TForeign> from, Expression<Func<TSource, IQueryable<TForeign>, IQueryable<TResult>>> pipeline)
Parameters
source
IQueryable
The source documents.
from
IMongoCollection
The foreign collection.
pipeline
Expression<Func<TSource, IQueryable, IQueryable>>
The pipeline to run against the foreign documents.
Returns
IQueryable<LookupResult<TSource, TResult>>
An IQueryable{LookupResult{TSource,TResult}} with the results of the Lookup.
Type Parameters
TSource
The type of the source documents.
TForeign
The type of the foreign documents.
TResult
The type of the pipeline output.
Lookup<TSource, TForeign, TField, TResult>(IQueryable, IMongoCollection, Expression<Func<TSource, TField>>, Expression<Func<TForeign, TField>>, Expression<Func<TSource, IQueryable, IQueryable>>)
Looks up documents in a foreign collection.
public static IQueryable<LookupResult<TSource, TResult>> Lookup<TSource, TForeign, TField, TResult>(this IQueryable<TSource> source, IMongoCollection<TForeign> from, Expression<Func<TSource, TField>> localField, Expression<Func<TForeign, TField>> foreignField, Expression<Func<TSource, IQueryable<TForeign>, IQueryable<TResult>>> pipeline)
Parameters
source
IQueryable
The source documents.
from
IMongoCollection
The foreign collection.
localField
Expression<Func<TSource, TField>>
The local field to compare against the foreign field.
foreignField
Expression<Func<TForeign, TField>>
The foreign field to compare against the local field.
pipeline
Expression<Func<TSource, IQueryable, IQueryable>>
The pipeline to run against the matching foreign documents.
Returns
IQueryable<LookupResult<TSource, TResult>>
An IQueryable{LookupResult{TSource,TResult}} with the results of the Lookup.
Type Parameters
TSource
The type of the source documents.
TForeign
The type of the foreign documents.
TField
The type of the fields being compared.
TResult
The type of the pipeline output.
Lookup<TSource, TDocument, TField>(IQueryable, Expression<Func<TSource, IEnumerable>>, Expression<Func<TSource, TField>>, Expression<Func<TDocument, TField>>)
Looks up documents in a list of foreign documents.
public static IQueryable<LookupResult<TSource, TDocument>> Lookup<TSource, TDocument, TField>(this IQueryable<TSource> source, Expression<Func<TSource, IEnumerable<TDocument>>> documents, Expression<Func<TSource, TField>> localField, Expression<Func<TDocument, TField>> foreignField)
Parameters
source
IQueryable
The source documents.
documents
Expression<Func<TSource, IEnumerable>>
The foreign documents.
localField
Expression<Func<TSource, TField>>
The local field to compare against the foreign field.
foreignField
Expression<Func<TDocument, TField>>
The foreign field to compare against the local field.
Returns
IQueryable<LookupResult<TSource, TDocument>>
An IQueryable{LookupResult{TSource,TDocument}} with the results of the Lookup.
Type Parameters
TSource
The type of the source documents.
TDocument
The type of the foreign documents.
TField
The type of the fields being compared.
Lookup<TSource, TDocument, TResult>(IQueryable, Expression<Func<TSource, IEnumerable>>, Expression<Func<TSource, IQueryable, IQueryable>>)
Looks up documents in a list of foreign documents.
public static IQueryable<LookupResult<TSource, TResult>> Lookup<TSource, TDocument, TResult>(this IQueryable<TSource> source, Expression<Func<TSource, IEnumerable<TDocument>>> documents, Expression<Func<TSource, IQueryable<TDocument>, IQueryable<TResult>>> pipeline)
Parameters
source
IQueryable
The source documents.
documents
Expression<Func<TSource, IEnumerable>>
The foreign documents.
pipeline
Expression<Func<TSource, IQueryable, IQueryable>>
The pipeline to run against the foreign documents.
Returns
IQueryable<LookupResult<TSource, TResult>>
An IQueryable{LookupResult{TSource,TResult}} with the results of the Lookup.
Type Parameters
TSource
The type of the source documents.
TDocument
The type of the foreign documents.
TResult
The type of the pipeline output.
Lookup<TSource, TDocument, TField, TResult>(IQueryable, Expression<Func<TSource, IEnumerable>>, Expression<Func<TSource, TField>>, Expression<Func<TDocument, TField>>, Expression<Func<TSource, IQueryable, IQueryable>>)
Looks up documents in a list of foreign documents.
public static IQueryable<LookupResult<TSource, TResult>> Lookup<TSource, TDocument, TField, TResult>(this IQueryable<TSource> source, Expression<Func<TSource, IEnumerable<TDocument>>> documents, Expression<Func<TSource, TField>> localField, Expression<Func<TDocument, TField>> foreignField, Expression<Func<TSource, IQueryable<TDocument>, IQueryable<TResult>>> pipeline)
Parameters
source
IQueryable
The source documents.
documents
Expression<Func<TSource, IEnumerable>>
The foreign documents.
localField
Expression<Func<TSource, TField>>
The local field to compare against the foreign field.
foreignField
Expression<Func<TDocument, TField>>
The foreign field to compare against the local field.
pipeline
Expression<Func<TSource, IQueryable, IQueryable>>
The pipeline to run against the matching foreign documents.
Returns
IQueryable<LookupResult<TSource, TResult>>
An IQueryable{LookupResult{TSource,TResult}} with the results of the Lookup.
Type Parameters
TSource
The type of the source documents.
TDocument
The type of the foreign documents.
TField
The type of the fields being matched.
TResult
The type of the pipeline output.