Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3943ED1BA for ; Wed, 5 Sep 2012 04:23:26 +0000 (UTC) Received: (qmail 22641 invoked by uid 500); 5 Sep 2012 04:23:24 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 22258 invoked by uid 500); 5 Sep 2012 04:23:20 -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 22217 invoked by uid 99); 5 Sep 2012 04:23:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Sep 2012 04:23:18 +0000 X-ASF-Spam-Status: No, hits=1.5 required=10 tests=FSL_RCVD_USER,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of pulkitsinghal@gmail.com designates 74.125.82.178 as permitted sender) Received: from [74.125.82.178] (HELO mail-we0-f178.google.com) (74.125.82.178) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Sep 2012 04:23:12 +0000 Received: by weyu7 with SMTP id u7so66481wey.23 for ; Tue, 04 Sep 2012 21:22:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=OVFy0GwF4S0wfuXn3mkyX2qeNn9+dMLaHoL9in6X1r4=; b=QtwVSGBsdMr6XJ+Fqx/tYNkj2RBmsm6RbOyu7teyDVRfFzVhCAAACUvSIr7IBe1U4I P5uH9NvhxGbZvvIApq2Fv7hn3rwVNTQnTnXKzb5Y4hU8vcvF8os92GyVbWuObyfWEEpa Eru6wZP7jxHXSMNK7/rWiO5S88sYoyfkGnHFrS8C29Vkcq2kK77FCRAlH1OV9Vl5hGIw G5mwE+7TSlkebo0v1k5cIBPRQdtjLDIQPhCS8oW3lvxb/gTyhvy9FPBOlDWp5WYJmy1D STceYAmS5t5fLNMKjfBNFWkPuwsp3vG4jxrpFYp5yosFAo3rpRazzOSwVRpYxJJ/qtzi vneg== MIME-Version: 1.0 Received: by 10.180.80.134 with SMTP id r6mr35012034wix.1.1346818561261; Tue, 04 Sep 2012 21:16:01 -0700 (PDT) Received: by 10.216.121.143 with HTTP; Tue, 4 Sep 2012 21:16:01 -0700 (PDT) Date: Tue, 4 Sep 2012 23:16:01 -0500 Message-ID: Subject: How to specify different sort order for the elements of a compound map key? From: Pulkit Singhal To: couchdb-user@apache.org Content-Type: multipart/alternative; boundary=f46d044403a0ebc1c204c8eca144 X-Virus-Checked: Checked by ClamAV on apache.org --f46d044403a0ebc1c204c8eca144 Content-Type: text/plain; charset=UTF-8 I have a map with a compound key which naturally sorts in an ascending order as: [No, 2011] [No, 2012] [Yes, 2011] [Yes, 2012] But I want it to sort as: [No, 2012] [No, 2011] [Yes, 2012] [Yes, 2011] Which means the first element in the key No/Yes should be sorted in an ascending order, whereas the timestamp should be sorted in a descending order. Is there a way to do this in a query? Or do I have to come up with some hack in my mapping function? --f46d044403a0ebc1c204c8eca144--