couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Evans" <>
Subject Iterating over/paging through large sets of documents
Date Fri, 25 Jul 2008 20:43:14 GMT
I think I read somewhere on the wiki that it's better to use startkey/endkey
to grab "pages" of documents, as opposed to using "count" because "count"
still has to materialize the entire set of results before filtering to the
specified count (or something like that).

In a case where you have a reasonable set of start/end key pairs in advance,
this makes perfect sense, but what is the best practice for paging through a
set of documents where you don't know any keys?  For example, can can you
start with count=10 to get the first ten results and then set the startkey
equal to the key of the 10th result from the first request and use count=11
to get the next 10 documents (ignoring the first one that overlaps with the
last set) or will this run into the same problem?

It feels like I am making this more complicated than it needs to be...
please tell me this is the case :)


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