Hello list,
I've been using and update handler which inserts new documents after 
time-stamping them. I am following the documentation found here:

http://wiki.apache.org/couchdb/Document_Update_Handlers

I've been using the following update handler successfully with 0.10.0 and 1.2.0 
on Ubuntu and Windows, but I just updated to 1.2.1 and this particular handler 
now fails with the error "bad return value".

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)];
}

Does anybody have insight on what causes the problem? Is it still "legal" to 
add new documents using update handlers?

Regards,
-Dominic



Reply via email to