incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Hahn <m...@hahnca.com>
Subject Re: error with an update handler that inserts documents
Date Mon, 25 Feb 2013 18:53:03 GMT
I'm surprised you could ever change the _id field.


On Mon, Feb 25, 2013 at 8:18 AM, Dominic Laflamme <flamz3d@gmail.com> wrote:

> Hello,
> I am using an update handler to insert new documents.
>
> the following works fine in 1.2.0 and 0.10.0, but no longer works in 1.2.1
>
>
> function(doc,req) {
> var data = JSON.parse(req.body);
> data[\'_id\'] = data.UniqueID;
> if ( data.timestamp == null )
> {
> data.timestamp = new Date().getTime();
> }
> return [ data, JSON.stringify(data)]}");
>
>
> this returns "bad return value".
>
> any ideas?
>
>
>
>
>
>

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