IFdbRangeQuery<TResult>
Namespace: FoundationDB.Client · interface
Implements: IFdbRangeQuery, IAsyncLinqQuery<TResult>, IAsyncQuery<TResult>
Query that will asynchronously stream decoded results from one or more GetRange operations
Methods
ForEachAsync
Task ForEachAsync(Action<TResult> action)
Executes an action on each key/value pairs in the range results
Task<TAggregate> ForEachAsync<TAggregate>(TAggregate aggregate, Action<TAggregate, TResult> action)
Executes an action on each key/value pairs in the range results
Paged
IFdbPagedQuery<TResult> Paged()
Returns pages of results, as they arrive
Processing a batch of results at a time can be more efficient than iterating on each individual key/value
Reverse
IFdbRangeQuery<TResult> Reverse()
Reverse the order in which the results will be returned
Returns: A new query object that will return the results in reverse order when executed
Calling Reverse on an already reversed query will cancel the effect, and the results will be returned in their natural order.
Note: Combining the effects of Take/Skip and Reverse may have an impact on performance, especially if the ReadYourWritesDisable option set.
Select
IFdbRangeQuery<TNew> Select<TNew>(Func<TResult, TNew> selector)
Projects each element of the range results into a new form.
selector— Function that is invoked for each source element, and will return the corresponding transformed element.
Returns: New range query that outputs the sequence of transformed elements
query.Select((kv) => $" = ")
IFdbRangeQuery<TNew> Select<TNew>(Func<TResult, int, TNew> selector)
Projects each element of the range results into a new form.
selector— Function that is invoked for each source element, and will return the corresponding transformed element.
Returns: New range query that outputs the sequence of transformed elements
query.Select((kv) => $" = ")
IFdbRangeQuery<TNew> Select<TNew>(Func<TResult, CancellationToken, Task<TNew>> selector)
Projects each element of the range results into a new form.
selector— Function that is invoked for each source element, and will return the corresponding transformed element.
Returns: New range query that outputs the sequence of transformed elements
query.Select((kv) => $" = ")
IFdbRangeQuery<TNew> Select<TNew>(Func<TResult, int, CancellationToken, Task<TNew>> selector)
Projects each element of the range results into a new form.
selector— Function that is invoked for each source element, and will return the corresponding transformed element.
Returns: New range query that outputs the sequence of transformed elements
query.Select((kv) => $" = ")
SelectMany
IFdbRangeQuery<TNew> SelectMany<TNew>(Func<TResult, IEnumerable<TNew>> selector)
IFdbRangeQuery<TNew> SelectMany<TNew>(Func<TResult, CancellationToken, Task<IEnumerable<TNew>>> selector)
IFdbRangeQuery<TNew> SelectMany<TNew>(Func<TResult, IAsyncEnumerable<TNew>> selector)
IFdbRangeQuery<TNew> SelectMany<TNew>(Func<TResult, IAsyncQuery<TNew>> selector)
IFdbRangeQuery<TNew> SelectMany<TCollection, TNew>(Func<TResult, IEnumerable<TCollection>> collectionSelector, Func<TResult, TCollection, TNew> resultSelector)
IFdbRangeQuery<TNew> SelectMany<TCollection, TNew>(Func<TResult, CancellationToken, Task<IEnumerable<TCollection>>> collectionSelector, Func<TResult, TCollection, TNew> resultSelector)
Skip
IFdbRangeQuery<TResult> Skip(int count)
Skips a specific number of results
count— Number of results to skip
Returns: A new query object that will ignore the count results when executed
Take
IFdbRangeQuery<TResult> Take(int count)
Returns only up to a specific number of results
count— Maximum number of results to return
Returns: A new query object that will only return up to count results when executed
IFdbRangeQuery<TResult> Take(Range range)
Returns only results in a specific range
range— Range of the results to return
Returns: A new query object that will only a range of results when executed
TakeWhile
IFdbRangeQuery<TResult> TakeWhile(Func<TResult, bool> condition)