couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mikeal Rogers <mikeal.rog...@gmail.com>
Subject Re: endkey doesn't obey limit parameter and always returns entries starting with offset 0
Date Mon, 13 Sep 2010 03:55:57 GMT
The document count of the db at the time of view generation or the document
count that emits at least one key in the index? Or do you really mean the
number of keys in the index?

On Sun, Sep 12, 2010 at 8:21 PM, Randall Leeds <randall.leeds@gmail.com>wrote:

> Any reason why we don't put a document count in the btree index to make
> skip
> cheap?
> >
> > On Sep 12, 2010, at 9:39 AM, Mikeal Rogers wrote:
> >
> >> For pagination you can use the skip parameter instead of trying to
> change
> >> the startkey for each pagination.
> >>
> >> http://wiki.apache.org/couchdb/HTTP_view_API#Querying_Options
> >>
> >> ?startkey="foo"&limit=10
> >> ?startkey="foo"&limit=10&skip=10
> >> ?startkey="foo"&limit=10&skip=20
> >>
> >
> > You can but you shouldn't.
> >
> > The right way to do it is to use startkey and limit, as documented here.
> >
> > http://guide.couchdb.org/draft/recipes.html#fast
> >
> >>
> >> On Sun, Sep 12, 2010 at 12:06 AM, Henrik Skupin <hskupin@gmail.com>
> wrote:
> >>
> >>> Hi,
> >>>
> >>> For my current Couch application I'm using pagination to show only 50
> >>> results per page. To navigate back and forward the endkey vs. startkey
> >>> parameters are used. While startkey in combination with limit is
> working
> >>> fine, endkey doesn't return results for [offset(endkey)-limit,
> >>> offset(endkey)] but for [0, limit]. This makes pagination impossible
> for
> me
> >>> and looks like to be a bug. An example you can find here:
> >>>
> >>> http://mozmill.hskupin.info/general/reports
> >>>
> >>> After opening the page click 'Next' twice and check the URL of the
> >>> 'Previous' link before clicking on it. The endkey parameter will not be
> >>> obeyed and a click on that link causes the first page to be opened.
> >>>
> >>> The code can be found at: http://github.com/whimboo/mozmill-dashboard
> >>>
> >>> Is the above problem a known broken behavior and worth filing a bug?
> >>>
> >>> Thanks,
> >>> Henrik
> >>>
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message