couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Josh803316 <josh803...@gmail.com>
Subject how should I handle JSON parsing in update handler
Date Sat, 11 Dec 2010 19:06:59 GMT
If I send a json string to my update handler as part of req.body what is the
best way to convert it to a JSON object?

Do the CouchDb js libraries already include a built in JSON parser or do I
have to use eval?

"active_test" : function(doc, req) {
      var active_test = eval('(' + req.body + ')');

      doc['active_test'] = active_test;
      return [doc, req.body];
     }

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