ChangeFeed 并读取当前时间对文档未来更新的所有更改
ChangeFeed and Read all changes to future updates to documents from current time
文档说明我们可以 Read all changes to future updates to documents from current time.
如果 StartFromBeginning
设置为 false 并且继续标记为 0,它会从查询开始提取所有文档吗?如果系统没有生成大量 inserts/updates,则可能没有任何文档,因此它会很快退出。在下面的示例中,假设在 while
的第一次迭代后没有更多结果,如果我们在那里睡了一段时间,如果有的话 query.HasMoreResults
是否为真inserts/updates?
new ChangeFeedOptions
{
PartitionKeyRangeId = pkRange.Id,
StartFromBeginning = true,
RequestContinuation = continuation,
MaxItemCount = -1
});
while (query.HasMoreResults)
{
// stuff since the query was initiated
// will exit if not much
// if Thread.Sleep() will query.HasMoreResults return true if items were inserted?
}
The documentation states that we can Read all changes to future updates to documents from current time. If StartFromBeginning is set to false and the continuation token is 0 it will pull all documents from the moment of the query going forward?
据我所知,将 RequestContinuation 属性 指定为 0,这不会 return 从当前时间改变。您可以将其设置为“*”,例如 RequestContinuation = "*"
。 This documentation 列出了增量处理 DocumentDB collections 变化的场景和请求 headers ReadDocumentFeed 操作,你会发现这个。
文档说明我们可以 Read all changes to future updates to documents from current time.
如果 StartFromBeginning
设置为 false 并且继续标记为 0,它会从查询开始提取所有文档吗?如果系统没有生成大量 inserts/updates,则可能没有任何文档,因此它会很快退出。在下面的示例中,假设在 while
的第一次迭代后没有更多结果,如果我们在那里睡了一段时间,如果有的话 query.HasMoreResults
是否为真inserts/updates?
new ChangeFeedOptions
{
PartitionKeyRangeId = pkRange.Id,
StartFromBeginning = true,
RequestContinuation = continuation,
MaxItemCount = -1
});
while (query.HasMoreResults)
{
// stuff since the query was initiated
// will exit if not much
// if Thread.Sleep() will query.HasMoreResults return true if items were inserted?
}
The documentation states that we can Read all changes to future updates to documents from current time. If StartFromBeginning is set to false and the continuation token is 0 it will pull all documents from the moment of the query going forward?
据我所知,将 RequestContinuation 属性 指定为 0,这不会 return 从当前时间改变。您可以将其设置为“*”,例如 RequestContinuation = "*"
。 This documentation 列出了增量处理 DocumentDB collections 变化的场景和请求 headers ReadDocumentFeed 操作,你会发现这个。