Hi,
I'm trying to parse a JSON string in an update function but on the PUT request
CouchDB tells me that "JSON is not defined".
My update function should do something like this (in the request body is the
JSON string):
function(doc, req) {
if (!doc) {
if (req.docId) {
doc = { _id : req.docId}
};
return [null, "error"];
}
doc.properties = JSON.parse(req.body);
return [doc, "success"];
}
Apparently JSON is not available in SpiderMonkey. Anyone who knows how I can
still easily parse a JSON string?
Thanks,
Mirko