Method WithIndex
WithIndex<TSource>(IQueryable<TSource>, string)
Sets an index hint on the query that's being built.
public static IQueryable<TSource> WithIndex<TSource>(this IQueryable<TSource> source, string indexName)
Parameters
source
IQueryable<TSource>The query being built.
indexName
stringThe name of the index to use.
Returns
- IQueryable<TSource>
New query where the expression includes a WithIndex method call.
Type Parameters
TSource
The type of the elements of source.
WithIndex<TSource>(IQueryable<TSource>, BsonDocument)
Sets an index hint on the query that's being built.
public static IQueryable<TSource> WithIndex<TSource>(this IQueryable<TSource> source, BsonDocument indexHint)
Parameters
source
IQueryable<TSource>The query being built.
indexHint
BsonDocumentHint for what index to use.
Returns
- IQueryable<TSource>
New query where the expression includes a WithIndex method call.
Type Parameters
TSource
The type of the elements of source.