IDocumentClient.ReadDatabaseFeedAsync(FeedOptions) Method


Reads the feed (sequence) of Database for a database account from the Azure Cosmos DB service as an asynchronous operation.

public System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.FeedResponse<Microsoft.Azure.Documents.Database>> ReadDatabaseFeedAsync (Microsoft.Azure.Documents.Client.FeedOptions options = null);
abstract member ReadDatabaseFeedAsync : Microsoft.Azure.Documents.Client.FeedOptions -> System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.FeedResponse<Microsoft.Azure.Documents.Database>>
Public Function ReadDatabaseFeedAsync (Optional options As FeedOptions = null) As Task(Of FeedResponse(Of Database))



(Optional) The request options for the request.


A System.Threading.Tasks containing a ResourceResponse<TResource> which wraps a Database containing the read resource record.


This exception can encapsulate many different types of errors. To determine the specific error always look at the StatusCode property. Some common codes you may get when creating a Document are:

StatusCodeReason for exception
429TooManyRequests - This means you have exceeded the number of request units per second. Consult the DocumentClientException.RetryAfter value to see how long you should wait before retrying this operation.


   int count = 0;
   string continuation = string.Empty;
       // Read the feed 10 items at a time until there are no more items to read
       FeedResponse<Database> response = await client.ReadDatabaseFeedAsync(new FeedOptions
                                                                       MaxItemCount = 10,
                                                                       RequestContinuation = continuation
       // Append the item count
       count += response.Count;
       // Get the continuation so that we know when to stop.
        continuation = response.ResponseContinuation;
   } while (!string.IsNullOrEmpty(continuation));

Applies to

See also