我正在尝试获取自上次运行以来更改的文档。当我设置 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();