Interface ICloudNativePersistenceQueryOperations
- Namespace
- Excalibur.Data.CloudNative
- Assembly
- Excalibur.Data.Abstractions.dll
Provides partition-scoped query capabilities for cloud-native document databases. Obtain via GetService(Type) on an ICloudNativePersistenceProvider instance.
public interface ICloudNativePersistenceQueryOperations
Methods
QueryAsync<TDocument>(CloudQueryRequest, CancellationToken)
Queries one page of documents within a partition.
Task<CloudQueryResult<TDocument>> QueryAsync<TDocument>(CloudQueryRequest query, CancellationToken cancellationToken) where TDocument : class
Parameters
queryCloudQueryRequestThe query to run, including the continuation token that resumes a previous page.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<CloudQueryResult<TDocument>>
The query results with cost information, and the continuation token for the next page.
Type Parameters
TDocumentThe document type.
Remarks
This returns a single page. When HasMoreResults is true the result set is incomplete; copy ContinuationToken into ContinuationToken and call again to obtain the next page.
Paging is server-side and happens whether or not the caller models it, so a caller that reads one page and stops silently processes part of its data. Loop until HasMoreResults is false.
A continuation token is opaque and belongs to the provider that issued it. Passing one to a different provider is rejected rather than silently misread — a token interpreted as a position it does not name resumes from nowhere and returns an empty page that looks like the end of the data.
Exceptions
- ArgumentException
ContinuationToken was supplied and was not issued by this provider.
- ArgumentOutOfRangeException
MaxItemCount was supplied and is not greater than zero.