Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 54607 invoked from network); 1 Aug 2010 23:23:31 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 1 Aug 2010 23:23:31 -0000 Received: (qmail 6016 invoked by uid 500); 1 Aug 2010 23:23:30 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 5970 invoked by uid 500); 1 Aug 2010 23:23:29 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 5962 invoked by uid 99); 1 Aug 2010 23:23:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Aug 2010 23:23:29 +0000 X-ASF-Spam-Status: No, hits=2.9 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [74.125.82.180] (HELO mail-wy0-f180.google.com) (74.125.82.180) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Aug 2010 23:23:25 +0000 Received: by wya21 with SMTP id 21so2995882wya.11 for ; Sun, 01 Aug 2010 16:23:03 -0700 (PDT) Received: by 10.216.11.66 with SMTP id 44mr4179625wew.69.1280704983334; Sun, 01 Aug 2010 16:23:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.38.140 with HTTP; Sun, 1 Aug 2010 16:22:43 -0700 (PDT) In-Reply-To: References: From: Avi Flax Date: Sun, 1 Aug 2010 19:22:43 -0400 Message-ID: Subject: Re: startkey_docid and "wildcard" paging To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=00163646da6c980217048ccb5d05 --00163646da6c980217048ccb5d05 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thanks Chris. I think you're saying that what I was trying isn't going to work. Maybe if I share my actual use case, you might be able to point me in the right direction. I have keys in my view like this: ["a", "1", "2010-06-10T12:14:35Z"], ["a", "1", "2010-06-10T13:14:35Z"], ["a", "2", "2010-06-10T14:14:35Z"], ["a", "2", "2010-06-10T15:14:35Z"], ["b", "1", "2010-06-10T16:14:35Z"], ["b", "1", "2010-06-10T17:14:35Z"], ["b", "2", "2010-06-10T18:14:35Z"], ["b", "2", "2010-06-10T19:14:35Z"] The first two elements are present because I want to filter by them =E2=80= =94 I want to get rows for "a" and "2", for example. The third element is present because I want the results sorted by date. So =E2=80=94 how can I add paging into this mix? What if I have 20 rows of = "a" and "2", each with a different date and a different doc_id, and I'm paging in groups of 10 =E2=80=94 if I can't use startkey_docid, then what can I do? Thanks! Avi On Sun, Aug 1, 2010 at 19:10, J Chris Anderson wrote: > > On Aug 1, 2010, at 2:43 PM, Avi Flax wrote: > >> Hi all, quick question =E2=80=94 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=3D["foo", "bar"] and endkey=3D["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. > > Chris > >> Any ideas? >> >> Thanks, >> Avi >> >> Avi Flax =C2=BB Partner =C2=BB Arc90 =C2=BB http://arc90.com >> Kindling: Innovation through Collaboration =C2=BB http://kindlingapp.com > > --00163646da6c980217048ccb5d05--