On Dec 19, 2012, at 5:32 PM, Scott Weber 
<[email protected]<mailto:[email protected]>> wrote:

I cannot see how manually creating a slightly more complex function then these
examples would not be begging for mistakes when forced to de-beautify it
manually for loading in through FUTON or curl.

Then don’t edit complex design docs using Futon or curl. Doing so is like 
trying to edit a PNG file using a raw hex editor.

There is no way to just tell "validate_doc_update" to load a function from a
whatever.js file?  So the function can remain readable?

If it were in a file it wouldn’t replicate. Part of the point of design 
documents is that they replicate along with the rest of the database.

In any case, I don’t think it’s a good idea to complicate CouchDB’s storage 
model just to avoid the need to use a tool to assemble complex design 
documents. It’s really quite easy to use your favorite scripting language to 
encode JSON data and PUT it to a design document. Or you could use CouchApp, 
which is kind of like that on steroids.

Alternatively, someone could improve Futon to make the contents of design 
documents more easily editable. For example, the web UI in Couchbase Server 2.0 
has a quite nice map/reduce editor that even has niceties like auto-indenting 
of the JavaScript code.

—Jens

Reply via email to