couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens Alfke <j...@couchbase.com>
Subject Re: storing regex in json
Date Fri, 18 Jan 2013 21:58:40 GMT

On Jan 18, 2013, at 1:19 PM, Stephen Bartell <snbartell@gmail.com> wrote:

> 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. 

I don’t think this has anything to do with regexes. It shouldn’t matter what’s in your
JS code (or even whether it’s JS or Erlang or FORTRAN) as long as you’ve properly quoted
it. To the document it’ll just be a string.

How are you quoting the code?

—Jens
Mime
View raw message