Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 54289 invoked from network); 8 Sep 2010 23:05:32 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 8 Sep 2010 23:05:32 -0000 Received: (qmail 30764 invoked by uid 500); 8 Sep 2010 23:05:31 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 30647 invoked by uid 500); 8 Sep 2010 23:05:30 -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 30639 invoked by uid 99); 8 Sep 2010 23:05:30 -0000 Received: from Unknown (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Sep 2010 23:05:30 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of james.jackson@cern.ch designates 137.138.144.179 as permitted sender) Received: from [137.138.144.179] (HELO CERNMX31.cern.ch) (137.138.144.179) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Sep 2010 23:05:04 +0000 Received: from CERNFE22.cern.ch (137.138.144.151) by cernmxgwlb2.cern.ch (137.138.144.179) with Microsoft SMTP Server (TLS) id 14.1.218.12; Thu, 9 Sep 2010 01:04:43 +0200 Received: from hepmbp3.home (81.154.98.136) by smtp.cern.ch (137.138.144.172) with Microsoft SMTP Server (TLS) id 14.1.218.12; Thu, 9 Sep 2010 01:04:42 +0200 From: James Jackson Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: Updates methods Date: Thu, 9 Sep 2010 00:04:38 +0100 Message-ID: <92C6E922-61D3-451D-8A40-75B742053184@cern.ch> To: MIME-Version: 1.0 (Apple Message framework v1078) X-Mailer: Apple Mail (2.1078) X-Originating-IP: [81.154.98.136] Keywords: CERN SpamKiller Note: -50 X-Virus-Checked: Checked by ClamAV on apache.org Hi, I'm trying to implement a method to modify all documents before they are = written to the DB. =46rom my poking around in various tickets, I believe = the updates entry in a design document is what I'm after (I'm running = 1.0.1). I have inserted the following design document into my database: { "_id":"_design/update", "_rev":"1-8800f3bdde13e5bcf6738635f0265b6d", "language":"javascript", "updates" : { "add_user":"function(doc, req){doc.newauth =3D req.userCtx; return = [doc, \"ok\"];}" } } However, this does not appear to get run when putting a document to the = database (nothing in the debug log but the usual). Is this functionality = supported? Am I doing something funny? All help appreciated! Regards, James.=