couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kiril Stankov <ki...@open-net.biz>
Subject Re: Update handlers
Date Thu, 29 Jan 2015 17:51:53 GMT
Hi again,

I'm still trying to use the Update Handlers, but I'm running into problem:

|||function(doc,req) {var field=req.query.field; var value = req.query.value; doc[field]=value;
return [doc, 'ok'];}

|||

The function executes, returns 'ok', the revision of the doc is 
increased by 2, but the fields are not changed.
The field I want to update is present in the doc.
Any idea what am I doing wrong?

Thanks in advance.
------------------------------------------------------------------------
*With best regards,*
Kiril Stankov,

On 1/29/2015 2:52 PM, Kiril Stankov wrote:
> Thanks all!
> ------------------------------------------------------------------------
> *With best regards,*
> Kiril Stankov,
> CEO
>
>
>            This Email disclaimer
>            <http://open-net.biz/emailsignature.html> is integral part
>            of this message.
>
> On 1/29/2015 11:57 AM, Alexander Shorin wrote:
>> On Thu, Jan 29, 2015 at 12:45 PM, Ingo Radatz 
>> <thewhorn@googlemail.com> wrote:
>>> With the help of a rewrite rule you could force an put to be handled 
>>> by an update handler before the doc gets stored
>> Need to keep in mind that this rewrite rule could be easily bypassed
>> by bulk update (POST /db/_bulk_docs).
>>
>> -- 
>> ,,,^..^,,,
>
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message