Hei chris, I've started looking at the relevant code, this thing seems feasible.
The list function will need two consume iterators in the correct order. Looking at the code in couch_httpd_show it seems at least complicated to make interleaved calls possible (i.e in the list code starting the iterator for the second view before consuming the first one completely, then returnin to the first one). Even if it can be done, it's just a bad idea. Can't find an elegant solution to enforce sequential use of the view iterators. This may work givem documentation and exceptions rowIterOne = getNextView() rowIterTwo = getNextView() getNextView() // null Also, we may consider to include the view names in the url instead of in the post body.\ That would make the call more explicit and consistent with the current api. _list/listname/design1/view1/design2/view2/../../designN/viewN/ Of course, the view parameters would still need to be passed in the post -teo On Thu, Dec 10, 2009 at 7:44 PM, Chris Anderson <[email protected]> wrote: > On Tue, Dec 8, 2009 at 1:11 PM, Matteo Caprari <[email protected]> > wrote: >> Hi Kosta. >> >> I'm trying to output an svg chart using a _list function, so no client >> is consuming the view directly. >> >> I could find the max and scale the data inside the list, but that >> would consume quite a lot of memory for big datasets, >> unless it was possibe to reset the iterator... >> > > There are a few use cases which could benefit from the ability to > specify an array of view queries in the POST body. By querying the > reduce, and then the non-reduce, you could do this in a list. But > first we need that feature. It would look like a more generalized form > of this: > > http://issues.apache.org/jira/browse/COUCHDB-523 > >> -teo >> >> On Tue, Dec 8, 2009 at 9:03 PM, <[email protected]> wrote: >>> Hi! >>> >>>> To scale the values I'need to know the maximum point, and I think >>>> it'not possible to do that with map/reduce. >>> >>> You can find the maximum point using map/reduce. The division of all point >>> must then be done manually given that point, e.g. in a view. Of course, >>> doing it this way has problems with atomicity. >>> >>> HTH, >>> Kosta >>> >>> >>> >> >> >> >> -- >> :Matteo Caprari >> [email protected] >> > > > > -- > Chris Anderson > http://jchrisa.net > http://couch.io > -- :Matteo Caprari [email protected]
