如何使用“自从” Cloudant DB 更改源中的参数?
我正在使用 Cloudant 数据库,并且希望通过 _changes
API 调用在更改源中使用 since
参数。正在寻找有关 since
参数的有效条目的指导。我知道 0
和 now
是选项,但有没有办法从定义的时间段获取更改?
I am working with a Cloudant db and would like to use the since
param in the changes feed using the _changes
API call. Was looking for guidance one what would be valid entries for the since
parameter. I know 0
and now
are options but is there a way to get changes from a defined time period?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
每当您调用
_changes
API 端点时,您都会在响应中获得last_seq
参数。这是一个令牌,可以在后续 API 调用中提供给_changes
端点以获取下一批更改。例如,如果您进行初始调用以获取名为
orders
的数据库中的更改:...然后您可以使用返回的
last_seq
参数获取后续更改:但是,应该指出的是,由于多种原因,针对此更改源的编程很复杂。例如,改变没有严格按时间顺序排序,并且可能在调用之间重复。请阅读此常见问题解答文档了解更多详细信息。
Whenever you call the
_changes
API endpoint, you get alast_seq
parameter in the response. This is a token that can be supplied to the_changes
endpoint in a subsequent API call to get the next batch of changes.For example, if you make an initial call to get changes in a database called
orders
:...you can then get subsequent changes by using the returned
last_seq
parameter:However, it should be noted that programming against this changes feed is complicated for a number of reasons. For example, the changes are not strictly ordered in time sequence and may be duplicated between calls. Please read this FAQ document for more details.