Description
View query results may return large amounts of data. We should offer a row callback which returns a JSON string whose contents is a single row.
There are awesome JSON libraries to do this task, and it's something that I've found myself doing in the Perl client.. so why not move it into libcouchbase and let everyone be happy? .
Basic idea:
Two callbacks are put into place. The first is a 'row callback' which receives rows, and the second is a complete callback, at which time any other non-row data is returned as a JSON object.
So for example
{ "total_rows" : 30,
"rows" : [
,
,
....
The row callback will first receive the string '
{ "id" : "foo" }', then the second time around, '
{"id":"bar"}'
The complete callback will return:
'
'