And it that OK to use those revisions in a business feature like that. I
though I read somewhere that document revisions were designed for sync
gateway to handle conflicts and they should not be used for functional
purposes like that?

Also, where can I find documentation on how to track document changes on
Sync Gateway using Java, and possibly hide those REST requests behind
library methods?

---
Sébastien Arbogast
http://sebastien-arbogast.com


2014-08-19 19:31 GMT+02:00 Jens Alfke <[email protected]>:

>
> On Aug 18, 2014, at 10:00 AM, Sebastien ARBOGAST <
> [email protected]> wrote:
>
> How can I do that when I track the changes feed on the sync gateway using
> something like Ektorp for example? Is there a proper way to get
> the previous revision of a document so that I can compare it with the
> current one and see that an endDate field has been added?
>
>
> First you need to get the revision history by issuing "GET
> /db/docid?revs=true". The response will include a "_revs" property that's a
> list of revision IDs; the second one will be the parent revision. Then "GET
> /db/docid?rev=*parent*" where *parent* is the parent revision ID.
>
> In the future we may add a callback to the sync function that lets it
> trigger external web-hooks; then you could code your sync function to call
> a hook when the endDate field was added.
>
> —Jens
>
> --
> You received this message because you are subscribed to the Google Groups
> "Couchbase Mobile" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mobile-couchbase/313DADC7-6563-40E2-97B0-A6A573D7DB48%40couchbase.com
> <https://groups.google.com/d/msgid/mobile-couchbase/313DADC7-6563-40E2-97B0-A6A573D7DB48%40couchbase.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/CAG1DMa-mbhFK%2BWg%3D%3DzBnoKHhJc4pT7sDDd73iH%2BzQDMMgEjGWw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to