Return-Path: Delivered-To: apmail-incubator-couchdb-user-archive@locus.apache.org Received: (qmail 82593 invoked from network); 5 Oct 2008 16:26:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Oct 2008 16:26:29 -0000 Received: (qmail 32928 invoked by uid 500); 5 Oct 2008 16:26:27 -0000 Delivered-To: apmail-incubator-couchdb-user-archive@incubator.apache.org Received: (qmail 32893 invoked by uid 500); 5 Oct 2008 16:26:26 -0000 Mailing-List: contact couchdb-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: couchdb-user@incubator.apache.org Delivered-To: mailing list couchdb-user@incubator.apache.org Received: (qmail 32882 invoked by uid 99); 5 Oct 2008 16:26:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Oct 2008 09:26:26 -0700 X-ASF-Spam-Status: No, hits=3.3 required=10.0 tests=DNS_FROM_SECURITYSAGE,HTML_MESSAGE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.128.189] (HELO fk-out-0910.google.com) (209.85.128.189) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Oct 2008 16:25:25 +0000 Received: by fk-out-0910.google.com with SMTP id 19so1832057fkr.12 for ; Sun, 05 Oct 2008 09:25:49 -0700 (PDT) Received: by 10.187.247.15 with SMTP id z15mr853180far.76.1223223949068; Sun, 05 Oct 2008 09:25:49 -0700 (PDT) Received: by 10.187.179.6 with HTTP; Sun, 5 Oct 2008 09:25:49 -0700 (PDT) Message-ID: Date: Sun, 5 Oct 2008 17:25:49 +0100 From: "Nick Johnson" To: couchdb-user@incubator.apache.org Subject: Sorting views with composite keys MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_27718_13442725.1223223949044" X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_27718_13442725.1223223949044 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline How would I construct a view with two keys, a and b, sorted first by a ascending, then by b descending? Composite keys are easy enough to generate, but the key [a,b] would only permit sorting both in ascending order (or both in descending order, if we scan in reverse). Can anyone suggest a way of modifying the keys to support heterogenous sort orders like this? My best idea so far is a monstrosity involving hex-encoded binary data. :) ------=_Part_27718_13442725.1223223949044--