couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From J Chris Anderson <>
Subject Re: startkey_docid and "wildcard" paging
Date Sun, 01 Aug 2010 23:10:42 GMT

On Aug 1, 2010, at 2:43 PM, Avi Flax wrote:

> Hi all, quick question — i'm having a little trouble with paging with
> startkey_docid
> I have a view whose keys look like: ["foo", "bar", "2010-06-10T12:14:35Z"]
> I'm querying the view with startkey=["foo", "bar"] and endkey=["foo","bar",{}]
> Which is returning what i expect, but i'm having trouble doing paging
> with this scenario; it almost seems like startkey_docid is being
> ignored.

startkey_docid is only useful when paging through a view where there are more rows emitted
for key X than your page size.

startkey_docid is subservient to the key. the internal implementation of collation looks like:

[key, docid]

so in your case 

[ ["foo", "bar", "2010-06-10T12:14:35Z"], docid]

so the startkey_docid only has any effect when the key is an exact match for the emitted key.

I hope that helps.


> Any ideas?
> Thanks,
> Avi
> Avi Flax » Partner » Arc90 »
> Kindling: Innovation through Collaboration »

View raw message