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 E6FC010A9D for ; Mon, 1 Jul 2013 20:16:52 +0000 (UTC) Received: (qmail 34980 invoked by uid 500); 1 Jul 2013 20:16:51 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 34938 invoked by uid 500); 1 Jul 2013 20:16:51 -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 34930 invoked by uid 99); 1 Jul 2013 20:16:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Jul 2013 20:16:51 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of rasmussen.bryan@gmail.com designates 74.125.82.47 as permitted sender) Received: from [74.125.82.47] (HELO mail-wg0-f47.google.com) (74.125.82.47) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Jul 2013 20:16:46 +0000 Received: by mail-wg0-f47.google.com with SMTP id l18so4041694wgh.2 for ; Mon, 01 Jul 2013 13:16:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=Q223DjD8IzxNilg7Pb54441eUjb6LAEi4bdGhJLCEiM=; b=DJALsYy37/hmJrg3zO2PqbX+hFnA3ZzGT8ylIdKj7a6HaVde/X5gDJkkucCqSHB1jo bCo/zRSO1IAyoTAlhPLOzPakYmTy6I0G+EICoRl8C35S+/+j6VsfgTWYxzZnt2jnAdA5 tg0sUv8qxA/Na4SdsS7XOEc5JWaHpVhW9d0kUPTS8jOZaLTlXn6e7k6lub+K33k0mms9 lBqIgyp7QR6Uhav22sN2Pior8AQKvQ1ojfCKJgy2Armzvbd+VLxHLmdTHjjhYV6P79j7 w0igq8izY3OeC5eEQEcDmWdQ1LRwOTsXmEA8i2ltoRH9y/lU0fymEXwGEMGVdNHfNjo/ djqg== MIME-Version: 1.0 X-Received: by 10.194.86.106 with SMTP id o10mr4932699wjz.93.1372709785373; Mon, 01 Jul 2013 13:16:25 -0700 (PDT) Received: by 10.194.162.103 with HTTP; Mon, 1 Jul 2013 13:16:25 -0700 (PDT) In-Reply-To: References: Date: Mon, 1 Jul 2013 22:16:25 +0200 Message-ID: Subject: Re: How to sort this view From: bryan rasmussen To: user@couchdb.apache.org Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked by ClamAV on apache.org Well if I put the second item first, like: [13023123123, "ueoorp189"] How do I query that, given that I don't know what my first value is going to be, but I do know that my second value is ueoorp189 Thanks, Bryan On Mon, Jul 1, 2013 at 10:11 PM, Robert Newson wrote: > Views are sorted by their key (the whole key and nothing but the key). > So make a view with your second item first to get the order you > require. > > B. > > > On 1 July 2013 21:04, Stanley Iriele wrote: >> What are the 1st and second values... Couch dB is sorting correctly you're >> just jot giving it the data it needs to sort on... So what values are you >> trying to sort by? >> On Jul 1, 2013 12:48 PM, "bryan rasmussen" >> wrote: >> >>> Hi, >>> >>> I have a view that outputs like the following: >>> >>> ["ueoorp189", 13023123123] >>> >>> ["ueoorp189", 13023123125] >>> >>> ["ueoorp189", 13023153123] >>> >>> ["ueoorp189", 13073123123] >>> I want a query that sorts it descending with the highest value in the >>> second key >>> >>> From what I've read this should be possible but I am not finding my >>> way to making it work. >>> >>> Do I have to do a map reduce function to do it? >>> >>> Thanks, >>> Bryan Rasmussen >>>