FeedIterator Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Cosmos Result set iterator that keeps track of the continuation token when retrieving results form a query.
public abstract class FeedIterator : IDisposable
type FeedIterator = class
interface IDisposable
Public MustInherit Class FeedIterator
Implements IDisposable
- Inheritance
-
FeedIterator
- Implements
Examples
Example on how to fully drain the query results.
QueryDefinition queryDefinition = new QueryDefinition("select c.id From c where c.status = @status")
.WithParameter("@status", "Failure");
using (FeedIterator feedIterator = this.Container.GetItemQueryStreamIterator(
queryDefinition))
{
while (feedIterator.HasMoreResults)
{
// Stream iterator returns a response with status code
using(ResponseMessage response = await feedIterator.ReadNextAsync())
{
// Handle failure scenario
if(!response.IsSuccessStatusCode)
{
// Log the response.Diagnostics and handle the error
}
}
}
}
Constructors
FeedIterator() |
Properties
HasMoreResults |
Tells if there is more results that need to be retrieved from the service |
Methods
Dispose() |
Releases the unmanaged resources used by the FeedIterator and optionally releases the managed resources. |
Dispose(Boolean) |
Releases the unmanaged resources used by the FeedIterator and optionally releases the managed resources. |
ReadNextAsync(CancellationToken) |
Get the next set of results from the cosmos service |
Applies to
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應