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 CDAEE10A7E for ; Mon, 1 Jul 2013 20:11:32 +0000 (UTC) Received: (qmail 20773 invoked by uid 500); 1 Jul 2013 20:11:31 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 20737 invoked by uid 500); 1 Jul 2013 20:11:31 -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 20728 invoked by uid 99); 1 Jul 2013 20:11:31 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Jul 2013 20:11:31 +0000 Received: from localhost (HELO mail-la0-f52.google.com) (127.0.0.1) (smtp-auth username rnewson, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Jul 2013 20:11:31 +0000 Received: by mail-la0-f52.google.com with SMTP id fo12so4837867lab.11 for ; Mon, 01 Jul 2013 13:11:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=WDDuZ1D0HRuf1WOj7NtAWl+MF/3/azZdRZ8F+V3Qokg=; b=W2euFi9wE32NB/3v87Y9C8HMtH8uex+SSuseywiSa1lIsq2dU6173778Qo3posjlYx XTDW2zP83K0BZwhUumlxwLnufnYYC50TLV5WlUo+gHNDnancC/KW6D5QcLhIic89N/+u xlyT+bM8wWITKmULJQWfhbsB+bft/XLeWfEsY29udMuSiIN/ZhiOVEasxkNWAohN3MtU dDflqouPDCBKyLkWoA3UUkNJDrsd/j4p13NcNzm+6DwCSNBVtnQZtBwPGDdPJ3Y7zzax KxwGGvWgWo2ac4o4ceVWh2PkYtkKHvmy57pjLMi2BlsKZR8S7Bw53WaxzsJD9NwHUWNu r3bw== MIME-Version: 1.0 X-Received: by 10.152.121.106 with SMTP id lj10mr13164344lab.27.1372709489232; Mon, 01 Jul 2013 13:11:29 -0700 (PDT) Received: by 10.112.168.66 with HTTP; Mon, 1 Jul 2013 13:11:29 -0700 (PDT) In-Reply-To: References: Date: Mon, 1 Jul 2013 21:11:29 +0100 Message-ID: Subject: Re: How to sort this view From: Robert Newson To: "user@couchdb.apache.org" Content-Type: text/plain; charset=ISO-8859-1 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 >>