Udostępnij za pośrednictwem


FeedIterator<T> Class

Definition

Cosmos Result set iterator that keeps track of the continuation token when retrieving results form a query.

public abstract class FeedIterator<T> : IDisposable
type FeedIterator<'T> = class
    interface IDisposable
Public MustInherit Class FeedIterator(Of T)
Implements IDisposable

Type Parameters

T
Inheritance
FeedIterator<T>
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<MyItem> feedIterator = this.Container.GetItemQueryIterator<MyItem>(
    queryDefinition))
{
    while (feedIterator.HasMoreResults)
    {
        FeedResponse<MyItem> response = await feedIterator.ReadNextAsync();
        foreach (var item in response)
        {
            Console.WriteLine(item);
        }
    }
}

Constructors

FeedIterator<T>()

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