Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 37C1F107C6 for ; Mon, 30 Dec 2013 20:17:39 +0000 (UTC) Received: (qmail 7446 invoked by uid 500); 30 Dec 2013 20:17:37 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 7346 invoked by uid 500); 30 Dec 2013 20:17:37 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 7337 invoked by uid 99); 30 Dec 2013 20:17:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Dec 2013 20:17:37 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of siriele2x3@gmail.com designates 209.85.216.170 as permitted sender) Received: from [209.85.216.170] (HELO mail-qc0-f170.google.com) (209.85.216.170) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Dec 2013 20:17:33 +0000 Received: by mail-qc0-f170.google.com with SMTP id x13so11511287qcv.1 for ; Mon, 30 Dec 2013 12:17:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=So0XgFUVT3rd/bRNARohnxOk+9pILGjK4aUjOo0m8LY=; b=azh6hDtqMAHf7zcA5IMJdur3INp54hVAn9k2wTcXa66X0iJVR7kLCmF3dQqUmI3NBN B3B7DBfbZNbkVksoyQGV2HzU0fokUhmsyhqzBcgKwxtrJrizEKaQoebFGdbbXoVNDwPg fqdC0fa/iB9Iuz/Vvx/skOP191xRadtlgwPHyXhfp1Eg6FF6zrg3TIltYtcPl31Qt3p8 T7o0JQn3rh24SUyj2uO3bU6Ks5V+DLJ5D4EPnZvzgkb7AppPxcRx5Fu5Nc7YQWW+Z7hR ZhHWzeO5S2TfcR1AUpRVwfusFe0IijJqpzWagYbkhxN3zIuP4IXBAROL6DccrZPHyvof ThPA== MIME-Version: 1.0 X-Received: by 10.224.20.202 with SMTP id g10mr109904994qab.66.1388434632454; Mon, 30 Dec 2013 12:17:12 -0800 (PST) Received: by 10.96.201.66 with HTTP; Mon, 30 Dec 2013 12:17:12 -0800 (PST) Received: by 10.96.201.66 with HTTP; Mon, 30 Dec 2013 12:17:12 -0800 (PST) In-Reply-To: References: Date: Mon, 30 Dec 2013 12:17:12 -0800 Message-ID: Subject: Re: CouchDB: Returning latest revision as update function result From: Stanley Iriele To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=001a11c2c83c0fb73404eec6216e X-Virus-Checked: Checked by ClamAV on apache.org --001a11c2c83c0fb73404eec6216e Content-Type: text/plain; charset=ISO-8859-1 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" 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? > --001a11c2c83c0fb73404eec6216e--