Does sync gw REST api support revs_info parameter on a document GET?

47 views
Skip to first unread message

Traun Leyden

unread,
Jul 16, 2014, 4:58:28 PM7/16/14
to mobile-c...@googlegroups.com

I'm trying to see the revision history for a document via:

curl 'http://<server>:<port>/todolite/cad0e680-edf2-4d11-96fe-e2729e99acca?revs_info=true'

(revs_info should work according to CouchDB docs)

But it's not returning any revision history:

{"_attachments":{"image":{"content_type":"image/jpg","digest":"sha1-4IQXrw5HI5cogoIoAZV7TT1+h5c=","length":534673,"revpos":1,"stub":true}},"_id":"cad0e680-edf2-4d11-96fe-e2729e99acca","_rev":"2-9b755d25f27daf25a4b8d3b9ce5cd748","checked":true,"created_at":"2014-07-15T17:17:40.012Z","list_id":"5cbee5d4-3220-4cfe-a795-618310c27018","title":"oak photo 2 droid","type":"task"}

Also I grepped the sync gateway codebase for revs_info and didn't find anything.

Is this supposed to work?  If not, is there any alternative method to getting the revision history of a document?


Jens Alfke

unread,
Jul 16, 2014, 7:31:37 PM7/16/14
to mobile-c...@googlegroups.com
Looks like ?revs_info hasn’t been implemented. It would be in handler.handleGetDoc( ) [rest/doc_api.go] if it were supported.

?revisions is supported, though. It’s more compact, but it doesn’t tell you whether the revisions are available or not.

—Jens

Traun Leyden

unread,
Jul 16, 2014, 7:41:27 PM7/16/14
to mobile-c...@googlegroups.com
Using ?revs worked for me:

curl 'http://<server>:<port>/todolite/e52b90c8-33e4-403c-9407-dcd51e52e62d?revs=true'

Returns:

{"_attachments":{"image":{"content_type":"image/jpg","digest":"sha1-tzEe/glc0+eNBdhewE4/WY5Hb9A=","length":220290,"revpos":1,"stub":true}},"_id":"e52b90c8-33e4-403c-9407-dcd51e52e62d","_rev":"3-b4e32de77544393bf8b4046d2d74d541","_revisions":{"ids":["b4e32de77544393bf8b4046d2d74d541","7355c812c1cff8d98e990e56666d78a9","eb5f9511ba65f4ea95f6bac505608dff"],"start":3},"checked":false,"created_at":"2014-07-15T17:14:03.292Z","list_id":"5cbee5d4-3220-4cfe-a795-618310c27018","title":"oak","type":"task"}




On Wed, Jul 16, 2014 at 4:31 PM, Jens Alfke <je...@couchbase.com> wrote:
Looks like ?revs_info hasn't been implemented. It would be in handler.handleGetDoc( ) [rest/doc_api.go] if it were supported.

?revisions is supported, though. It's more compact, but it doesn't tell you whether the revisions are available or not.

--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 mobile-couchba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/2F11CE38-9613-4680-99B3-B59F344823EF%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages