Yes, you have to escape things to pack them into the string. The couchapp tool is quite handy for this, edit local .js files (fully indented, comments, etc) and then couchapp folds that into the JSON structure needed by couchdb.
B. On 20 December 2012 00:29, Mark Hahn <[email protected]> wrote: > Seriously. > > It is stored as json and control chars aren't allowed in json strings. > All tools should handle the conversion in and out. Futon handles it > fine. My custom scripts handle it fine. Why would you be looking at > the json string directly? > > On Wed, Dec 19, 2012 at 4:08 PM, Scott Weber <[email protected]> wrote: >> Clearly, this can't be the way it is supposed to behave. >> >> I must be missing something, somewhere... >> >> In a design doc, I put a function to validate. I used to validate_doc_update >> key of the design JSON. All taken from examples in the guide. Then I found >> out... >> >> The javascript in the design doc cannot have newlines..? cannot have tabs..? >> Cannot be formatted so that it's readable..? Seriously? >> >> There has to be a way to put readable code into this. What am I missing? >> All >> the code in the "The Definitive Guide' is loaded with comments, line breaks, >> etc... >> >> -Scott
