Calls to access documents using design documents aren’t returning rev in their data
it used to be included inside [“value”]["_sync"]. _sync appears to have been removed from this data (I guess most of the data in here is only of internal relevance to sync gateway) and the online docs suggest that rev should now be inside each row in “rev”, but it isnt.
That’s correct, the rev number isn’t included in the metadata returned as part of a result row. You can emit it in the value alongside the other properties you are already emitting however.
function(doc, meta) {
var object = {};
…
var object.rev = doc.rev;
emit("domain", object);
}
Looking at a document in the Couchbase Server bucket it looks like the revision number is stored as _rev (top-level field) and rev in the _sync dictionary.
I don’t have _rev by default in my documents in couchbase, only if I write them in myself, but I’m only running 3.0.1 Community Edition, maybe this has changed since.
But I think I can pull it out from the meta if this is available to the view function
Using _rev in the docs is pleasingly old school can we have _id too?