Method Lookup
Lookup<TSource, TForeign, TField>(IQueryable<TSource>, IMongoCollection<TForeign>, 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
sourceIQueryable<TSource>The source documents.
fromIMongoCollection<TForeign>The foreign collection.
localFieldExpression<Func<TSource, TField>>The local field to compare against the foreign field.
foreignFieldExpression<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
TSourceThe type of the source documents.
TForeignThe type of the foreign documents.
TFieldThe type of the fields being compared.
Lookup<TSource, TForeign, TResult>(IQueryable<TSource>, IMongoCollection<TForeign>, Expression<Func<TSource, IQueryable<TForeign>, IQueryable<TResult>>>)
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
sourceIQueryable<TSource>The source documents.
fromIMongoCollection<TForeign>The foreign collection.
pipelineExpression<Func<TSource, IQueryable<TForeign>, IQueryable<TResult>>>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
TSourceThe type of the source documents.
TForeignThe type of the foreign documents.
TResultThe type of the pipeline output.
Lookup<TSource, TForeign, TField, TResult>(IQueryable<TSource>, IMongoCollection<TForeign>, Expression<Func<TSource, TField>>, Expression<Func<TForeign, TField>>, Expression<Func<TSource, IQueryable<TForeign>, IQueryable<TResult>>>)
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
sourceIQueryable<TSource>The source documents.
fromIMongoCollection<TForeign>The foreign collection.
localFieldExpression<Func<TSource, TField>>The local field to compare against the foreign field.
foreignFieldExpression<Func<TForeign, TField>>The foreign field to compare against the local field.
pipelineExpression<Func<TSource, IQueryable<TForeign>, IQueryable<TResult>>>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
TSourceThe type of the source documents.
TForeignThe type of the foreign documents.
TFieldThe type of the fields being compared.
TResultThe type of the pipeline output.
Lookup<TSource, TDocument, TField>(IQueryable<TSource>, Expression<Func<TSource, IEnumerable<TDocument>>>, 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
sourceIQueryable<TSource>The source documents.
documentsExpression<Func<TSource, IEnumerable<TDocument>>>The foreign documents.
localFieldExpression<Func<TSource, TField>>The local field to compare against the foreign field.
foreignFieldExpression<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
TSourceThe type of the source documents.
TDocumentThe type of the foreign documents.
TFieldThe type of the fields being compared.
Lookup<TSource, TDocument, TResult>(IQueryable<TSource>, Expression<Func<TSource, IEnumerable<TDocument>>>, Expression<Func<TSource, IQueryable<TDocument>, IQueryable<TResult>>>)
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
sourceIQueryable<TSource>The source documents.
documentsExpression<Func<TSource, IEnumerable<TDocument>>>The foreign documents.
pipelineExpression<Func<TSource, IQueryable<TDocument>, IQueryable<TResult>>>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
TSourceThe type of the source documents.
TDocumentThe type of the foreign documents.
TResultThe type of the pipeline output.
Lookup<TSource, TDocument, TField, TResult>(IQueryable<TSource>, Expression<Func<TSource, IEnumerable<TDocument>>>, Expression<Func<TSource, TField>>, Expression<Func<TDocument, TField>>, Expression<Func<TSource, IQueryable<TDocument>, IQueryable<TResult>>>)
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
sourceIQueryable<TSource>The source documents.
documentsExpression<Func<TSource, IEnumerable<TDocument>>>The foreign documents.
localFieldExpression<Func<TSource, TField>>The local field to compare against the foreign field.
foreignFieldExpression<Func<TDocument, TField>>The foreign field to compare against the local field.
pipelineExpression<Func<TSource, IQueryable<TDocument>, IQueryable<TResult>>>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
TSourceThe type of the source documents.
TDocumentThe type of the foreign documents.
TFieldThe type of the fields being matched.
TResultThe type of the pipeline output.