From user-return-4286-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Fri Apr 03 20:57:47 2009 Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 97206 invoked from network); 3 Apr 2009 20:57:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Apr 2009 20:57:46 -0000 Received: (qmail 67126 invoked by uid 500); 3 Apr 2009 20:57:45 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 67054 invoked by uid 500); 3 Apr 2009 20:57:45 -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 67044 invoked by uid 99); 3 Apr 2009 20:57:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Apr 2009 20:57:45 +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 clairon@gmail.com designates 209.85.220.163 as permitted sender) Received: from [209.85.220.163] (HELO mail-fx0-f163.google.com) (209.85.220.163) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Apr 2009 20:57:39 +0000 Received: by fxm7 with SMTP id 7so1288637fxm.11 for ; Fri, 03 Apr 2009 13:57:17 -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=97IzH8w3c4tIQK9XOTTIhkRkd9zp4rbylygK2Dtcf2k=; b=SyYwVW2ZZq9gzTkInmnBvpML4cnRuqjzmFMsZJMCzpHQ+hHadFlL8m9nyfntCseCiJ RJza5dlAcPkn+Qxk7Bk8WFoGumLDhKUQwtaWTlfXCslsk1TOhYMq21v6uQRM+dml9/2K e0TlRyEIK7kvZ59A21a9UL7b/VLrhhM0GSK1c= 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=OTnZdvrmmSufNqNsT4AHTjK8eYui37PHZM5vwcJKPdTgiF8ORJS3kTkwZUHLZnbO0A nhd8UAJVszCU1C26qxjd9+o+uKAw9vPZi+FThKYT8q5JhvHtRH7Q8hMFK1td/fsnIuC4 QO+g+1iF+qaDXmyQSsHIddFuCykk8i8r2LuR0= MIME-Version: 1.0 Received: by 10.103.172.7 with SMTP id z7mr794227muo.15.1238792237575; Fri, 03 Apr 2009 13:57:17 -0700 (PDT) Date: Fri, 3 Apr 2009 22:57:17 +0200 Message-ID: <4b307fd10904031357s683fa560oe8fc96e43febca68@mail.gmail.com> Subject: sorting by reduce value From: Nicolas Clairon 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 Hi ! I'm getting through a sorting issue with couchdb. Let's say we have a classic map/reduce for counting the number of documents by type : function(doc){ emit(doc.doc_type, 1); } function(key, values){ return sum(values); } the results would be : type1 => 3 type2 => 1 type3 => 2 ... My question is simple : How can we sort the result by the compute reduce value ? We can sort by key, but can we sort by value ? Regards, Nicolas