couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Bartell <>
Subject storing regex in json
Date Fri, 18 Jan 2013 21:19:17 GMT

I'm trying to do something similar to the couchdb view engine.  I want to store javascript
snippets in a couchdb document, and then use a process (node.js) to execute the snippets.

The problem is stringifying the snippets into json.  What I currently do is just compress
my js, then paste it into the document via futon's create new document page.  This seems to
work fine.  Unless regex is involved, obviously because regex isn't a JSON primitive. 

But futon serializes this somehow for the views. I've dug around the couchjs source code to
see how the futon ui does this on the _temp_view page, but I must be braindead here. Im not
finding it.

Could someone point me in the right direction?

View raw message