couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Max Ogden <...@maxogden.com>
Subject Re: Pagination in couchdb
Date Thu, 21 Jul 2011 08:02:12 GMT
hiiii there

to do startkey_docid you have to specify both startkey and startkey_docid.
here's an example working query
http://monocl.es/api/stream?descending=true&limit=20&startkey=%222011-07-19T04%3A24%3A43.466Z%22&startkey_docid=%2222160c79004a9821c0414e69ad01b330%22&skip=1(demo:
http://monocl.es scroll to the bottom of the page to kick off the infinite
scroll and then look at your XHR activity)

you can also do pagination using just skip:
https://github.com/maxogden/recline/blob/master/attachments/script/recline.js#L105(demo:
http://max.couchone.com/senators/_design/recline/_rewrite)

cheers,

max

On Thu, Jul 21, 2011 at 12:54 AM, Monica Razdan <monica@almende.org> wrote:

> Hello,
>
> I'm a newbie to couchdb v1.1.0. I have been struggling with implementation
> of pagination in couchdb. I have been through the guide and wiki pages to
> understand the concept of startkey and startkey_docid to implement
> pagination however I am unable to understand the implementation part. Do I
> need to set startkey in my query ? I am using couchapp for building my
> _attachments and views. Is there a way to achieve pagination without
> getting
> around to use path binders?
>
> Thanks,
> Monica
>

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