As many of you will know the response from a couchdb view is as follows
{"rows":[
{"key":"1","value":{"Col1":"Some Value"}},
{"key":"2","value":{"Col1":"Another Value"}},
]}
Well I would like to collate that to
[{"key":"1","value":{"Col1":"Some Value"}},
{"key":"2","value":{"Col1":"Another Value"}}]
I am considering using a “List Function” to collate the response but I wanted to know the potential performance overhead of doing something like this?? Is it worth it… or should I consider changing all my code to handle the different response??
Thanks
Damo
A list function runs in a separate process (
couchjs) which is connected to couchdb via standard i/o. Data is serialized to/from JSON to communicate with this channel. In other words, all of your rows will be serialized and sent tocouchjs; andcouchjswill send the results back.Therefore, a list function will add (at least) an O(n) latency to receive your results. For small (I say less than 10,000 documents but it depends on your needs) view results, it is well worth the convenience. For very large amounts of rows, you may find benefit in upgrading your clients.