couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ross Bates <rba...@gmail.com>
Subject Re: startkey/endkey and descending=true
Date Wed, 17 Jun 2009 23:04:47 GMT
The syntax I'm using is something I picked up on the mailing list. It's
supposed to allow you to select according the first value in the key array.
I'm not using ranges or anything for the key. So if all docs look like this

[foo, 123]
[foo, 456]
[bar, 123]

?startkey=[%22foo%22]&endkey=[%22foo%22,{}]<http://couch:5984/msg_db/_view/views/msg_by_tag_date?startkey=%5B%22Tag%22%5D&endkey=%5B%22Tag%22,%7B%7D%5D>

would return this

[foo, 123]
[foo, 456]






On Wed, Jun 17, 2009 at 5:58 PM, Blair Nilsson <blair.nilsson@gmail.com>wrote:

> Maybe your start key and end key are around the wrong way for descending
> order?
>
> On Thu, Jun 18, 2009 at 10:46 AM, Ross Bates<rbates@gmail.com> wrote:
> > Hi All - I have a view that uses an array for it's key. I want to select
> by
> > the first value and sort by the second in descending order (it sorts
> > properly in ascending order by default)
> >
> > I'm using this syntax to select the rows and everything works fine
> >
> >
> http://couch:5984/msg_db/_view/views/msg_by_tag_date?startkey=[%22Tag%22]&endkey=[%22Tag%22,{}]<http://couch:5984/msg_db/_view/views/msg_by_tag_date?startkey=%5B%22Tag%22%5D&endkey=%5B%22Tag%22,%7B%7D%5D>
> >
> > but when I add the descending parameter like this:
> >
> >
> http://couch:5984/msg_db/_view/views/msg_by_tag_date?descending=true&startkey=[%22Tag%22]&endkey=[%22Tag%22,{}]<http://couch:5984/msg_db/_view/views/msg_by_tag_date?descending=true&startkey=%5B%22Tag%22%5D&endkey=%5B%22Tag%22,%7B%7D%5D>
> >
> > couch.log indicates a 200 but I get 0 rows back.
> >
> > Is what am I trying to do possible?
> >
> > Thanks for any help!
> >
> > -Ross
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message