1

In Raven DB, using the rest api I can get all documents of a particular collection (related documents grouped by entity name) using this:

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

I can get all new / updated documents since a given etag using this:

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

The problem is, the above returns new / updated documents from all collections.

My question is, is it possible to query Ravens rest api to return only documents that have changed since a given etag, for a specific collection only? I have tried the options below however the etag parameter seems to get ignored for any api calls except the /docs endpoint.

//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
joecity
  • 106
  • 5

1 Answers1

0

No, you cannot use this like that. You can use the LastUpdated date in a query to Raven/DocumentsByEntityName, though.

Ayende Rahien
  • 22,925
  • 1
  • 36
  • 41
  • 3
    Thanks - it would be really handy to be able to make wider use of the etags in Raven. It seems a shame to have to use dates in our queries to get the updated document set when etags are stored and available. – joecity Sep 23 '14 at 10:29