From user-return-14223-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Thu Dec 16 12:20:37 2010 Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 35896 invoked from network); 16 Dec 2010 12:20:37 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 16 Dec 2010 12:20:37 -0000 Received: (qmail 75692 invoked by uid 500); 16 Dec 2010 12:20:35 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 75455 invoked by uid 500); 16 Dec 2010 12:20:35 -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 75447 invoked by uid 99); 16 Dec 2010 12:20:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Dec 2010 12:20:34 +0000 X-ASF-Spam-Status: No, hits=2.9 required=10.0 tests=HTML_MESSAGE,SPF_NEUTRAL,T_FRT_BELOW2 X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.210.180] (HELO mail-iy0-f180.google.com) (209.85.210.180) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Dec 2010 12:20:30 +0000 Received: by iyi12 with SMTP id 12so1639414iyi.11 for ; Thu, 16 Dec 2010 04:20:08 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.30.73 with SMTP id t9mr6027109ibc.144.1292502007747; Thu, 16 Dec 2010 04:20:07 -0800 (PST) Received: by 10.231.19.6 with HTTP; Thu, 16 Dec 2010 04:20:07 -0800 (PST) In-Reply-To: References: Date: Thu, 16 Dec 2010 10:20:07 -0200 Message-ID: Subject: Re: Doubts with start and end keys + descending=true From: Fabio Batalha Cunha dos Santos To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=0022152d607d0b13dd049786138b --0022152d607d0b13dd049786138b Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Yes, This issue was understood. But when I want just a single key the flit did not take effect once the startkey is the same of the endkey. For example: These are my keys. "key":["arg","20101000"] "key":["arg","20101000"] "key":["arg","20101100"] "key":["arg","20101100"] "key":["scl","20101000"] "key":["scl","20101000"] "key":["scl","20101100"] I want to get only the key=3D"arg" so my query is: ?startkey=3D[%22arg%22,{}]&endkey=3D[%22arg%22] For this query the result is: "key":["arg","20101000"] "key":["arg","20101000"] "key":["arg","20101100"] "key":["arg","20101100"] That's perfect. Now I want to enable the descending true expecting the result bellow.The idea is to bring at first the most recent registers because the second parameter is ISO DATE.So my query is: ?startkey=3D[%22arg%22,{}]&endkey=3D[%22arg%22]&descending=3Dtrue "key":["arg","20101100"] "key":["arg","20101100"] "key":["arg","20101000"] "key":["arg","20101000"] Instead of this result I have a empty list. Thanks, *Fabio Batalha C. Santos* Colegiado SciELO www.scielo.org FAPESP - CNPq - BIREME - FapUNIFESP On Wed, Dec 15, 2010 at 7:49 PM, Nils Breunese wrote: > You quite literally need to flip your startkey and endkey, so you'll need > to query with ?startkey=3D[%22arg%22,{}]&endkey=3D[%22mex%22]&descending= =3Dtrue > > Nils. > ________________________________________ > Van: Fabio Batalha Cunha dos Santos [fabio.batalha@scielo.org] > Verzonden: woensdag 15 december 2010 21:24 > Aan: user@couchdb.apache.org > Onderwerp: Re: Doubts with start and end keys + descending=3Dtrue > > Now the descending parameter is working but I'm still not having the > expected result. > > For example: > > 1. Results from arg to mex in ascending mode. > > http://fabiobatalha.couchone.com/scieloorg/_design/couchdb/_view/article_= date?startkey=3D[%22arg%22]&endkey=3D[%22mex%22,{}] > > the result have arg,chl and mex keys. That's ok! > > 2. Now flipping. Results from mex to arg in descending mode. > > http://fabiobatalha.couchone.com/scieloorg/_design/couchdb/_view/article_= date?startkey=3D[%22mex%22]&endkey=3D[%22arg%22,{}]&descending=3Dtrue > > the result have only keys =3D "chl". That isn't ok, I was expecting mex, = chl > and arg in the descending mode. > > Other Example: > > 1. Results with keys =3D arg > > http://fabiobatalha.couchone.com/scieloorg/_design/couchdb/_view/article_= date?startkey=3D[%22arg%22]&endkey=3D[%22arg%22,{}] > > the result is a list with key =3D arg. That's ok! > > > http://fabiobatalha.couchone.com/scieloorg/_design/couchdb/_view/article_= date?startkey=3D[%22arg%22]&endkey=3D[%22arg%22,{}]&descending=3Dtrue > > In this example I can't just flip the key values once I'm filtering only > one > key value "arg" > the result is a empty list with. That isn't ok, I was expecting a key=3D"= arg" > list in the descending mode > > Thanks, > *Fabio Batalha C. Santos* > Colegiado SciELO > www.scielo.org > FAPESP - CNPq - BIREME - FapUNIFESP > > > > On Wed, Dec 15, 2010 at 5:08 PM, Matthew Woodward >wrote: > > > On Wed, Dec 15, 2010 at 10:58 AM, Sebastian Cohnen < > > sebastiancohnen@googlemail.com> wrote: > > > > > try to flip startkey/endkey when discending=3Dtrue :) > > > > > > > Yep, ran into this just yesterday and that was indeed the trick. > > -- > > Matthew Woodward > > matt@mattwoodward.com > > http://blog.mattwoodward.com > > identi.ca / Twitter: @mpwoodward > > > > Please do not send me proprietary file formats such as Word, PowerPoint= , > > etc. as attachments. > > http://www.gnu.org/philosophy/no-word-attachments.html > > > ------------------------------------------------------------------------ > VPRO www.vpro.nl > ------------------------------------------------------------------------ > --0022152d607d0b13dd049786138b--