Is there a way to return the newly created document’s _rev and _id field to the client from an _update function?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can, however the solution is not perfect.
You already know the document
_idin the update function. Either you are computing it yourself, or using user input, or if you wish to let CouchDB produce an ID automatically, then use thereq.uuidvalue.Unfortunately, you do not know the
_revin the show function. However, CouchDB will send it to the client in the HTTP headerX-Couch-Update-NewRev.For example: