Fetching Sync Gateway revision from metadata

Hi. In versions Sync Gateway 1.5 and Couchbase 5.0, Sync Gateway’s document’s metadata are stored outside the content. What is the way to access revision using N1QL? In META() I only receive “cas”, “expiration”, “flags”, “id” and “type”…

As discussed in this blog post you can query for the document XAttr via the Sync Gateway _raw API.

As an example :-

curl -X GET http://localhost:4985/my_db/_raw/my_doc \
   -H 'accept: application/json' \
   -H 'cache-control: no-cache' \
   -H 'content-type: application/json'

Currently, there is no way to query for the document sync metadata via the server’s N1QL interface