couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stanley Iriele <siriele...@gmail.com>
Subject Re: CouchDB: Returning latest revision as update function result
Date Mon, 30 Dec 2013 20:17:12 GMT
Yes...the new ID and rev are returned as headers.

X-Couch-Id is the  new ID
X-Couch-Update-Newrev is the new revision

Here's where its mentioned in the docs

http://docs.couchdb.org/en/latest/api/ddoc/render.html?highlight=update#put--db-_design-ddoc-_update-func-docid
On Dec 30, 2013 3:11 PM, "Hank Knight" <hknight555@gmail.com> wrote:

> I use this in my update function:
> return [doc, doc._rev]
>
> When a document is updated using the update function, I want the
> latest revision information to be returned, however that returns
> revision information of the document BEFORE being updated by the
> update function.  So it actually always returns a previous revision
> and not the latest revision.
>
> Is it possible for the update function to return the latest revision
> information or will I have to get this from a separate query after
> updating the document with the update function?
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message