nlangcoy opened a new issue #1057: No way of Paginating List function results?
URL: https://github.com/apache/couchdb/issues/1057
 
 
   Hello! I'm developing an app which needs to make use of a list function that 
accepts a couple of conditions. I am looking for a way to paginate the results 
of the list function but I haven't found a way. 
   Currently, pagination works by setting the limit and skip parameters of the 
view, right?
   
   ## Expected Behavior
   <!--- If you're describing a bug, tell us what should happen -->
   I'm trying to invoke a list function against a view like this: 
https://localhost:6984/mydb/_design/mydesigndoc/_list/myList/mydesigndoc/myView?limit=50
 and get 50 items.
   
   ## Current Behavior
   <!--- If describing a bug, tell us what happens instead of the expected 
behavior -->
   Currently, the query above retrieves 50 items from myView and then those 50 
items are fed into the list function. But if any of those 50 items don't 
satisfy the conditions I have inside the list function, I'll end up receiving < 
50 items.
   
   ## Possible Solution
   <!--- Not obligatory, but suggest a fix/reason for the bug, -->
   Since the number of output documents a list function generates is controlled 
by the creator(of the function), there's no one way of doing the pagination 
that will work for everybody, but I suggest a function **getRow(index)** 
    or an **offset(index)** callable inside a list function that lets us jump 
to/ start iterating from a certain row. That way, the actual pagination is left 
to the creator by specifying some parameters (e.g. page, pagesize) of his own 
and control the # of output.
   
   ## Context
   <!--- How has this issue affected you? What are you trying to accomplish? -->
   I'm trying to list items of a view but filter these items against a specific 
Date-Time range. 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to