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 1160F10C22 for ; Mon, 1 Jul 2013 21:02:58 +0000 (UTC) Received: (qmail 59070 invoked by uid 500); 1 Jul 2013 21:02:56 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 59035 invoked by uid 500); 1 Jul 2013 21:02:56 -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 59027 invoked by uid 99); 1 Jul 2013 21:02:56 -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 21:02:56 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of siriele2x3@gmail.com designates 209.85.212.169 as permitted sender) Received: from [209.85.212.169] (HELO mail-wi0-f169.google.com) (209.85.212.169) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Jul 2013 21:02:51 +0000 Received: by mail-wi0-f169.google.com with SMTP id c10so4513685wiw.0 for ; Mon, 01 Jul 2013 14:02:30 -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=DkslUywMg6yuEM34cpgt6qdAq6ii7zgAJcXOnNbE7B8=; b=Lt8xbmm+AuyTsP5h69TDW2Nn1ogCBdIWs1HMy8BxLMbEblMZfc67VcM5LFl7IND8h/ kt2E/8rpxlUTQvWYlRJSlYsLK3dplebpozHywwhbuNgn5nWeNLRjryCc70aPnTYCuJf2 3OaSMMgDsVPZ3fIavCCxTwrkno/n76Ttumgo31pDykNL/r0YF+7kPFl/RwN+tGSfB5r4 TLEOYRfNfxoI6hKZEVxrHGiL9VUeYzuCeFOKaCmAbQrjuDvFJBYs1ek2oXQkz6TXFLm6 9tLi/XWUWPr3ahqq1WID8TLfJMt0vGaG3HL1InQELyBLBjaIf/wU6AzVoWbZif1WzXPT QODA== MIME-Version: 1.0 X-Received: by 10.180.36.12 with SMTP id m12mr13429240wij.10.1372712550386; Mon, 01 Jul 2013 14:02:30 -0700 (PDT) Received: by 10.194.64.136 with HTTP; Mon, 1 Jul 2013 14:02:30 -0700 (PDT) Received: by 10.194.64.136 with HTTP; Mon, 1 Jul 2013 14:02:30 -0700 (PDT) In-Reply-To: References: Date: Mon, 1 Jul 2013 14:02:30 -0700 Message-ID: Subject: Re: How to sort this view From: Stanley Iriele To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=e89a8f5030acf1d0c004e0798b01 X-Virus-Checked: Checked by ClamAV on apache.org --e89a8f5030acf1d0c004e0798b01 Content-Type: text/plain; charset=ISO-8859-1 But if you reverse that emit and reverse that key you should be fine On Jul 1, 2013 1:53 PM, "bryan rasmussen" wrote: > damn, you're right. I had deleted the other testing key earlier. > > > On Mon, Jul 1, 2013 at 10:38 PM, Stanley Iriele > wrote: > > [{},"oeerpa189"] is equivalent to [{}] as far as I've seen...it may be > that > > you don't have any other key so its not obvious > > On Jul 1, 2013 1:28 PM, "bryan rasmussen" > wrote: > > > >> ah you're right, I needed to do startkey=[{},"ueoorp189"] and > >> descending=true to get it to sort right. > >> > >> Thanks, > >> Bryan > >> > >> > >> On Mon, Jul 1, 2013 at 10:22 PM, Stanley Iriele > >> wrote: > >> > Put reverse your start key end key > >> > On Jul 1, 2013 1:22 PM, "bryan rasmussen" > >> wrote: > >> > > >> >> right I need to only get the first key, but sort by the second. > >> >> > >> >> On Mon, Jul 1, 2013 at 10:19 PM, Stanley Iriele < > siriele2x3@gmail.com> > >> >> wrote: > >> >> > Do you care about other keys being mixed in?....I guess are you > >> trying yo > >> >> > group by that first key that you have? > >> >> > 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" < > >> rasmussen.bryan@gmail.com> > >> >> >>> 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 > >> >> >>>> > >> >> > >> > --e89a8f5030acf1d0c004e0798b01--