RavenDB - 您可以使用etag查询特定实体以仅获取已更改的文档吗?

时间:2014-09-18 17:05:29

标签: ravendb ravendb-http

在Raven DB中,使用rest api我可以使用以下方法获取特定集合的所有文档(按实体名称分组的相关文档):

//Get all documents from a collection
http://localhost:8080/databases/{MyDatabase}/indexes/dynamic/{MyEntity}

我可以使用以下标签获取所有新的/更新的文件:

//Get all new/updated documents since a given etag
http://localhost:8080/databases/{MyDatabase}/docs?etag=01000000-0000-0010-0000-000000000001

问题是,上面的内容会从所有集合中返回新的/更新的文档。

我的问题是,是否可以查询Ravens rest api仅返回自给定etag以来已更改的文档,仅针对特定集合?我已尝试过以下选项,但除了/ docs端点之外,任何api调用都会忽略etag参数。

//etag parameter is ignored for these calls
http://localhost:8080/databases/{MyDatabase}/indexes/dynamic/{MyEntity}?etag=01000000-0000-0010-0000-000000000001

http://localhost:8080/databases/{MyDatabase}/indexes/Raven/DocumentsByEntityName?query=Tag:{MyEntity}&etag=01000000-0000-0010-0000-000000000001

1 个答案:

答案 0 :(得分:0)

不,你不能那样使用它。 但是,您可以在查询中将LastUpdated日期用于Raven / DocumentsByEntityName。