couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hank Knight <hknight...@gmail.com>
Subject CouchDB: Trouble with update handler
Date Mon, 29 Jul 2013 01:19:20 GMT
My update handler is here: (please click on the link)
https://zurv3aqzm.iriscouch.com/zzz/_design/_design/task

{
  updates: {
    function (doc, req) {
      doc.ts = 123;
      doc.hello = 'world';
      return [doc, toJSON(doc)];
  }
}

When adding documents or updating documents, I want the value of
"hello" to always be "world" and I want the value of "ts" to be 123.

This is how I add a document:

curl -X POST http://zurv3aqzm.iriscouch.com/zzz -d
'{"_id":"1","user":"joe","fruit":"watermelon","type":"melons","ts":null,"hello":null}'
-H "Content-Type: application/json"

The values for "hello" and "ts" remain unchanged.

What step am I missing or doing wrong?

That database is live and available for testing.

Mime
View raw message