DocumentClient.CreateDocumentChangeFeedQuery メソッド

定義

オーバーロード

CreateDocumentChangeFeedQuery(String, ChangeFeedOptions)

オーバーロードされます。 このメソッドは、Azure Cosmos DB サービスのコレクションの下にドキュメントの変更フィード クエリを作成します。

CreateDocumentChangeFeedQuery(Uri, ChangeFeedOptions)

Azure Cosmos DB サービスでドキュメントの変更フィード クエリを作成する拡張メソッド。

CreateDocumentChangeFeedQuery(String, ChangeFeedOptions)

オーバーロードされます。 このメソッドは、Azure Cosmos DB サービスのコレクションの下にドキュメントの変更フィード クエリを作成します。

public Microsoft.Azure.Documents.Linq.IDocumentQuery<Microsoft.Azure.Documents.Document> CreateDocumentChangeFeedQuery (string collectionLink, Microsoft.Azure.Documents.Client.ChangeFeedOptions feedOptions);
abstract member CreateDocumentChangeFeedQuery : string * Microsoft.Azure.Documents.Client.ChangeFeedOptions -> Microsoft.Azure.Documents.Linq.IDocumentQuery<Microsoft.Azure.Documents.Document>
override this.CreateDocumentChangeFeedQuery : string * Microsoft.Azure.Documents.Client.ChangeFeedOptions -> Microsoft.Azure.Documents.Linq.IDocumentQuery<Microsoft.Azure.Documents.Document>
Public Function CreateDocumentChangeFeedQuery (collectionLink As String, feedOptions As ChangeFeedOptions) As IDocumentQuery(Of Document)

パラメーター

collectionLink
String

ドキュメントの読み取り元のコレクションを指定します。

feedOptions
ChangeFeedOptions

クエリ結果フィードを処理するためのオプション。

戻り値

クエリ結果セット。

実装

string partitionKeyRangeId = "0";   // Use client.ReadPartitionKeyRangeFeedAsync() to obtain the ranges.
string checkpointContinuation = null;
ChangeFeedOptions options = new ChangeFeedOptions
{
    PartitionKeyRangeId = partitionKeyRangeId,
    RequestContinuation = checkpointContinuation,
    StartFromBeginning = true,
};
using(var query = client.CreateDocumentChangeFeedQuery(collection.SelfLink, options))
{
    while (true)
    {
        do
        {
            var response = await query.ExecuteNextAsync<Document>();
            if (response.Count > 0)
            {
                var docs = new List<Document>();
                docs.AddRange(response);
                // Process the documents.
                // Checkpoint response.ResponseContinuation.
            }
        }
        while (query.HasMoreResults);
        Task.Delay(TimeSpan.FromMilliseconds(500)); // Or break here and use checkpointed continuation token later.
    }       
}

注釈

ChangeFeedOptions.PartitionKeyRangeId を指定する必要があります。

こちらもご覧ください

適用対象

CreateDocumentChangeFeedQuery(Uri, ChangeFeedOptions)

Azure Cosmos DB サービスでドキュメントの変更フィード クエリを作成する拡張メソッド。

public Microsoft.Azure.Documents.Linq.IDocumentQuery<Microsoft.Azure.Documents.Document> CreateDocumentChangeFeedQuery (Uri collectionLink, Microsoft.Azure.Documents.Client.ChangeFeedOptions feedOptions);
abstract member CreateDocumentChangeFeedQuery : Uri * Microsoft.Azure.Documents.Client.ChangeFeedOptions -> Microsoft.Azure.Documents.Linq.IDocumentQuery<Microsoft.Azure.Documents.Document>
override this.CreateDocumentChangeFeedQuery : Uri * Microsoft.Azure.Documents.Client.ChangeFeedOptions -> Microsoft.Azure.Documents.Linq.IDocumentQuery<Microsoft.Azure.Documents.Document>
Public Function CreateDocumentChangeFeedQuery (collectionLink As Uri, feedOptions As ChangeFeedOptions) As IDocumentQuery(Of Document)

パラメーター

collectionLink
Uri

ドキュメントの読み取り元のコレクションを指定します。

feedOptions
ChangeFeedOptions

クエリ結果フィードを処理するためのオプション。

戻り値

クエリ結果セット。

実装

適用対象