cosmosdb CreateDocumentChangeFeedQuery ChangeFeedOption StartTime不返回文档

时间:2018-07-14 17:41:36

标签: azure azure-cosmosdb azure-cosmosdb-sqlapi

我正在尝试获取自上次运行以来已更改的文档。当我设置ChangeFeed选项StartTime时,我没有得到任何行。设置StartFromBeginning时,我正在获取文档。

IDocumentQuery<Document> query = client.CreateDocumentChangeFeedQuery(
                 UriFactory.CreateDocumentCollectionUri(DatabaseId, CollectionId),
                new ChangeFeedOptions
                {
                    StartFromBeginning = true,
                    PartitionKeyRangeId = partitionkeyRangeId,
                    RequestContinuation = token,
                    MaxItemCount = Batchsize,
                    // Set reading time: only show change feed results modified since StartTime
                    StartTime = DateTime.Now - TimeSpan.FromDays(365)

                });

var temp = query.ExecuteNextAsync()。GetAwaiter()。GetResult();

0 个答案:

没有答案