Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 81656 invoked from network); 21 May 2009 23:40:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 21 May 2009 23:40:04 -0000 Received: (qmail 88890 invoked by uid 500); 21 May 2009 23:40:16 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 88809 invoked by uid 500); 21 May 2009 23:40:16 -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 88797 invoked by uid 99); 21 May 2009 23:40:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 May 2009 23:40:16 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of patcito@gmail.com designates 209.85.218.170 as permitted sender) Received: from [209.85.218.170] (HELO mail-bw0-f170.google.com) (209.85.218.170) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 May 2009 23:40:08 +0000 Received: by bwz18 with SMTP id 18so1580126bwz.11 for ; Thu, 21 May 2009 16:39:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=ks7CJMA57cNlFUt4C9dbw3olYw0tJ3Tx4qbjPN0/8UQ=; b=RCureww7y0OiGz6E3StpuPeLddAvEhLPFcSk31/qBY7Vcqy/HqJJ4pWcWSV8VL7wGn zDNMnjmXYDo6GqxnvL2/j439EwJCjNqXD0xauhTKhZCLLDfhql7+eMnprx0RwaLQ2Fak QJFRMMbTi+lTe5Ccf6Mz0hS8TYRdddy0i9aU4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=NO6DvQniST2Dx8Boxco5m+nTGnQqkWsbDaDjvftYeTSyyEEBWab1+c1MJPNGgJNOwC PwD+tQg7bNa93ArATbNFKsmNJ/pDrKbqVB7M2XKuiGtnWYCPT1yEZFx4IhTe3Li2krQi 7qipXOqlEFTLfygerhGv9J6Rmy9oBYqr+fmA0= MIME-Version: 1.0 Received: by 10.239.152.7 with SMTP id t7mr221666hbb.9.1242949186910; Thu, 21 May 2009 16:39:46 -0700 (PDT) Date: Thu, 21 May 2009 18:39:46 -0500 Message-ID: <6b6419750905211639u7888a6e6k5e9c166454819377@mail.gmail.com> Subject: need help for a query From: Patrick Aljord To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hey all, I have a blog with many posts and many comments done by many users, a comment has a post_id, a user_id and a created_at holding the creation date of the comment. I would like to query the 20 latest comments done only by user X, Y and Z together, that is to say, if user X did the 20 latest comments then it should return those 20 latest comments done by x only, but if not, it should return for example something like 10 comments done by X, 7 comments done by Y and 3 by Z, I hope you get the idea. And I want them to be ordered by created_at. I don't think there is a way to do so with one query only. What would be the best way to do this query with couchdb? Thanks in advance, Pat