2009/6/18 Nils Breunese <[email protected]>:
> Douglas Fils wrote:
>
>> Thanks much! I did in fact miss this. Wow.. I'm really excited now
>> about couchdb's potential in a linked data ecosystem.
>
> Yes, being able to write show functions is nice, but you'll have to request
> another URL if you want the document in a non-JSON format, which is not
> really the REST way of doing business.
>
> Of course you can just always request the show function URL, also for JSON
> output, but AFAIK the output of show functions is not prerendered by CouchDB
> (yet?), so performance-wise it might be better to go to the document-URL
> itself directly if you want JSON. Are there any plans to (maybe optionally)
> prerender the output of show functions? Maybe this is even possible for list
> functions if heads, rows and tails are prerendered separately?
>
> Nils Breunese.
>
Something like this woudl allow you to follow REST principle :
function(doc, req) {
return respondWith(req, {
"html": return { body: "somehtml" },
"json": return { "headers": "Content-Type: application/json", json: doc }
}
}
But only for get for now.
- benoît