Mid From PDF Azure Microsoft Azure

How do you implement pagination in Cosmos DB?

  • Use QueryDefinition and FeedIterator with MaxItemCount.
var query = new QueryDefinition("SELECT * FROM c");
var iterator = container.GetItemQueryIterator<MyItem>(query,
requestOptions: new QueryRequestOptions { MaxItemCount = 10 });

while (iterator.HasMoreResults)

{
foreach (var item in await iterator.ReadNextAsync())
{

Console.WriteLine(item.Id);

}
}

More from Microsoft Azure Tutorial

All questions for this course
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details