incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Jackson <>
Subject Updates methods
Date Wed, 08 Sep 2010 23:04:38 GMT

I'm trying to implement a method to modify all documents before they are written to the DB.
From 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:

   "updates" : {
      "add_user":"function(doc, req){doc.newauth = 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!

View raw message