DocumentClient.ReadDocumentCollectionFeedAsync メソッド

定義

オーバーロード

ReadDocumentCollectionFeedAsync(String, FeedOptions)

非同期操作として、Azure Cosmos DB サービスからデータベースの フィード (シーケンス) DocumentCollection を読み取ります。

ReadDocumentCollectionFeedAsync(Uri, FeedOptions)

Azure Cosmos DB サービスから非同期操作として、データベースのコレクションのフィード (シーケンス) を読み取ります。

ReadDocumentCollectionFeedAsync(String, FeedOptions)

非同期操作として、Azure Cosmos DB サービスからデータベースの フィード (シーケンス) DocumentCollection を読み取ります。

public System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.FeedResponse<Microsoft.Azure.Documents.DocumentCollection>> ReadDocumentCollectionFeedAsync (string collectionsLink, Microsoft.Azure.Documents.Client.FeedOptions options = default);
abstract member ReadDocumentCollectionFeedAsync : string * Microsoft.Azure.Documents.Client.FeedOptions -> System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.FeedResponse<Microsoft.Azure.Documents.DocumentCollection>>
override this.ReadDocumentCollectionFeedAsync : string * Microsoft.Azure.Documents.Client.FeedOptions -> System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.FeedResponse<Microsoft.Azure.Documents.DocumentCollection>>
Public Function ReadDocumentCollectionFeedAsync (collectionsLink As String, Optional options As FeedOptions = Nothing) As Task(Of FeedResponse(Of DocumentCollection))

パラメーター

collectionsLink
String

読み取るリソースの SelfLink。 例: /dbs/db_rid/colls/

options
FeedOptions

(省略可能)要求の要求オプション。

戻り値

System.Threading.Tasks読み取りリソース レコードをResourceResponse<TResource>含む をDocumentCollectionラップする を含む 。

実装

例外

が設定されていない場合 collectionsLink

この例外は、さまざまな種類のエラーをカプセル化できます。 特定のエラーを特定するには、常に StatusCode プロパティを参照してください。 ドキュメントの作成時に取得できる一般的なコードは次のとおりです。

StatusCode例外の理由
404NotFound - 読み取ろうとしたリソース フィードが存在しなかったことを意味します。 親の rid が正しいことを確認します。
429TooManyRequests - つまり、1 秒あたりの要求ユニット数を超えています。 DocumentClientException.RetryAfter の値を調べ、この操作を再試行する前に待機する必要がある時間を確認します。

int count = 0;
string continuation = string.Empty;
do
{
    // Read the feed 10 items at a time until there are no more items to read
    FeedResponse<DocumentCollection> response = await client.ReadDocumentCollectionFeedAsync("/dbs/db_rid/colls/",
                                                    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));

こちらもご覧ください

適用対象

ReadDocumentCollectionFeedAsync(Uri, FeedOptions)

Azure Cosmos DB サービスから非同期操作として、データベースのコレクションのフィード (シーケンス) を読み取ります。

public System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.FeedResponse<Microsoft.Azure.Documents.DocumentCollection>> ReadDocumentCollectionFeedAsync (Uri documentCollectionsUri, Microsoft.Azure.Documents.Client.FeedOptions options = default);
abstract member ReadDocumentCollectionFeedAsync : Uri * Microsoft.Azure.Documents.Client.FeedOptions -> System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.FeedResponse<Microsoft.Azure.Documents.DocumentCollection>>
override this.ReadDocumentCollectionFeedAsync : Uri * Microsoft.Azure.Documents.Client.FeedOptions -> System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.FeedResponse<Microsoft.Azure.Documents.DocumentCollection>>
Public Function ReadDocumentCollectionFeedAsync (documentCollectionsUri As Uri, Optional options As FeedOptions = Nothing) As Task(Of FeedResponse(Of DocumentCollection))

パラメーター

documentCollectionsUri
Uri

ドキュメント コレクションの URI。

options
FeedOptions

要求の要求オプション。

戻り値

非同期操作のサービス応答を表すタスク オブジェクト。

実装

適用対象