incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stanley Iriele <siri...@breaktimestudios.com>
Subject Re: CouchDB: Trouble with update handler
Date Mon, 29 Jul 2013 06:20:27 GMT
Well....that's not how you add update handlers.. And that's not the way to
call update handlers either..
On Jul 28, 2013 6:19 PM, "Hank Knight" <hknight555@gmail.com> wrote:

> 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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message