Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 3779 invoked from network); 13 Jan 2009 21:39:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Jan 2009 21:39:23 -0000 Received: (qmail 17664 invoked by uid 500); 13 Jan 2009 21:39:18 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 17631 invoked by uid 500); 13 Jan 2009 21:39:17 -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 17620 invoked by uid 99); 13 Jan 2009 21:39:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Jan 2009 13:39:17 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jchris@gmail.com designates 64.233.170.190 as permitted sender) Received: from [64.233.170.190] (HELO rn-out-0910.google.com) (64.233.170.190) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Jan 2009 21:39:09 +0000 Received: by rn-out-0910.google.com with SMTP id k50so224645rnd.3 for ; Tue, 13 Jan 2009 13:38:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=UpBWAEdoXeIVdi2Jo7wGeeg6M2QyX+2a1ufWbPtvJcg=; b=VkOziN7PxFOoixKL+IrzO3/C0XK3lgIDUtO2T8VDvOUenQNo7pJutTSaR1UDMexx54 TcGcz3RzF4EL46yk7BiaB0Rasqjg2G1cgs8DOThAYu4HskeCrHaB07tR4Nl5FJjF2zb4 unY215kZdCZlvD2sji/Ckn2etHbt6vI6NQBU0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=i9BOxHFpvBYYnLj41bga7Rg1HfftYU5IVFox/OngR+6UQy9c3/LAO0HC8t86WB5VnY keZUMo7FuQB23h49DHe/zs8LixGpo6RI9kS/nFUXIBWa6haGCwB+Q7RnuZnAXqhrw87Y gBBOQ7KHTUVxSm/95O9E0HxRLQ6QqrJBim96c= Received: by 10.64.209.6 with SMTP id h6mr20884230qbg.10.1231882727937; Tue, 13 Jan 2009 13:38:47 -0800 (PST) Received: by 10.65.158.2 with HTTP; Tue, 13 Jan 2009 13:38:47 -0800 (PST) Message-ID: Date: Tue, 13 Jan 2009 13:38:47 -0800 From: "Chris Anderson" To: user@couchdb.apache.org Subject: Re: Sort by date and find by key In-Reply-To: <92fc798f0901131335gbb933cdmdbc0eb7a4c0f70ee@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <92fc798f0901131335gbb933cdmdbc0eb7a4c0f70ee@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org On Tue, Jan 13, 2009 at 1:35 PM, Nicolas Fouch=E9 w= rote: > Hi, > > Let's say I have documents like this: {date: '2008/06/09 13:52:11 > +0000', name:'Roger'} > I'd like to find documents matching a name, and sorted by date. I know > that for sorting documents by date, the 'date' field has to be in the > key emitted by the view. > > In this case, what to I have to emit if I need to see only documents > which name is 'Roger' but sorted by date ? > I would do something like: > emit([doc.name, doc.date], null); > > Can I query this view without having to specify the date ? I need > these documents to be sorted by date, because I'll paginate on them. Totally, all you need is a startkey and endkey that bracket the keys you care about. eg startkey=3D["Roger"] endkey=3D["Roger",{}] See http://wiki.apache.org/couchdb/View_collation > > Thanks, > Nicolas > --=20 Chris Anderson http://jchris.mfdz.com