You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by bryan rasmussen <ra...@gmail.com> on 2013/07/01 21:47:53 UTC
How to sort this view
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
Re: How to sort this view
Posted by Stanley Iriele <si...@gmail.com>.
But if you reverse that emit and reverse that key you should be fine
On Jul 1, 2013 1:53 PM, "bryan rasmussen" <ra...@gmail.com> wrote:
> damn, you're right. I had deleted the other testing key earlier.
>
>
> On Mon, Jul 1, 2013 at 10:38 PM, Stanley Iriele <si...@gmail.com>
> 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" <ra...@gmail.com>
> 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 <si...@gmail.com>
> >> wrote:
> >> > Put reverse your start key end key
> >> > On Jul 1, 2013 1:22 PM, "bryan rasmussen" <ra...@gmail.com>
> >> 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 <rnewson@apache.org
> >
> >> >> 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 <si...@gmail.com>
> 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
> >> >> >>>>
> >> >>
> >>
>
Re: How to sort this view
Posted by bryan rasmussen <ra...@gmail.com>.
damn, you're right. I had deleted the other testing key earlier.
On Mon, Jul 1, 2013 at 10:38 PM, Stanley Iriele <si...@gmail.com> 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" <ra...@gmail.com> 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 <si...@gmail.com>
>> wrote:
>> > Put reverse your start key end key
>> > On Jul 1, 2013 1:22 PM, "bryan rasmussen" <ra...@gmail.com>
>> 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 <si...@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 <rn...@apache.org>
>> >> 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 <si...@gmail.com> 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
>> >> >>>>
>> >>
>>
Re: How to sort this view
Posted by Stanley Iriele <si...@gmail.com>.
[{},"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" <ra...@gmail.com> 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 <si...@gmail.com>
> wrote:
> > Put reverse your start key end key
> > On Jul 1, 2013 1:22 PM, "bryan rasmussen" <ra...@gmail.com>
> 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 <si...@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 <rn...@apache.org>
> >> 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 <si...@gmail.com> 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
> >> >>>>
> >>
>
Re: How to sort this view
Posted by bryan rasmussen <ra...@gmail.com>.
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 <si...@gmail.com> wrote:
> Put reverse your start key end key
> On Jul 1, 2013 1:22 PM, "bryan rasmussen" <ra...@gmail.com> 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 <si...@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 <rn...@apache.org>
>> 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 <si...@gmail.com> 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" <ra...@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
>> >>>>
>>
Re: How to sort this view
Posted by Stanley Iriele <si...@gmail.com>.
Put reverse your start key end key
On Jul 1, 2013 1:22 PM, "bryan rasmussen" <ra...@gmail.com> 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 <si...@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 <rn...@apache.org>
> 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 <si...@gmail.com> 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" <ra...@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
> >>>>
>
Re: How to sort this view
Posted by bryan rasmussen <ra...@gmail.com>.
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 <si...@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 <rn...@apache.org> 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 <si...@gmail.com> 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" <ra...@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
>>>>
Re: How to sort this view
Posted by Stanley Iriele <si...@gmail.com>.
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 <rn...@apache.org> 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 <si...@gmail.com> 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" <ra...@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
>>>
Re: How to sort this view
Posted by bryan rasmussen <ra...@gmail.com>.
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 <rn...@apache.org> 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 <si...@gmail.com> 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" <ra...@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
>>>
Re: How to sort this view
Posted by Robert Newson <rn...@apache.org>.
http://wiki.apache.org/couchdb/HTTP_view_API#Querying_Options
The view is sorted by the full key, you can't ask for it to return
ascending on the first item and descending on the second, if that's
the question?
I think you just need ?descending=true when you query in this case, though.
B.
On 1 July 2013 21:18, bryan rasmussen <ra...@gmail.com> wrote:
> I agree it is ascending in value, but how to make it descend.
>
> thanks,
> Bryan
>
> On Mon, Jul 1, 2013 at 10:14 PM, Stanley Iriele <si...@gmail.com> wrote:
>> Sorry I read that wrong... I thought all keys were the same "should
>> probably be wearing my glasses" it looks like its sorting normally... The
>> second column is ascending in value as you'd expect
>> On Jul 1, 2013 1:11 PM, "Robert Newson" <rn...@apache.org> 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 <si...@gmail.com> 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" <ra...@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
>>> >>
>>>
Re: How to sort this view
Posted by bryan rasmussen <ra...@gmail.com>.
I agree it is ascending in value, but how to make it descend.
thanks,
Bryan
On Mon, Jul 1, 2013 at 10:14 PM, Stanley Iriele <si...@gmail.com> wrote:
> Sorry I read that wrong... I thought all keys were the same "should
> probably be wearing my glasses" it looks like its sorting normally... The
> second column is ascending in value as you'd expect
> On Jul 1, 2013 1:11 PM, "Robert Newson" <rn...@apache.org> 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 <si...@gmail.com> 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" <ra...@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
>> >>
>>
Re: How to sort this view
Posted by bryan rasmussen <ra...@gmail.com>.
yeah but descending=true gives me empty rows.
thanks,
Bryan
On Mon, Jul 1, 2013 at 10:17 PM, Robert Newson <ro...@gmail.com> wrote:
> unless you mean ?descending=true ?
>
>
> On 1 July 2013 21:14, Stanley Iriele <si...@gmail.com> wrote:
>> Sorry I read that wrong... I thought all keys were the same "should
>> probably be wearing my glasses" it looks like its sorting normally... The
>> second column is ascending in value as you'd expect
>> On Jul 1, 2013 1:11 PM, "Robert Newson" <rn...@apache.org> 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 <si...@gmail.com> 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" <ra...@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
>>> >>
>>>
Re: How to sort this view
Posted by Robert Newson <ro...@gmail.com>.
unless you mean ?descending=true ?
On 1 July 2013 21:14, Stanley Iriele <si...@gmail.com> wrote:
> Sorry I read that wrong... I thought all keys were the same "should
> probably be wearing my glasses" it looks like its sorting normally... The
> second column is ascending in value as you'd expect
> On Jul 1, 2013 1:11 PM, "Robert Newson" <rn...@apache.org> 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 <si...@gmail.com> 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" <ra...@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
>> >>
>>
Re: How to sort this view
Posted by Stanley Iriele <si...@gmail.com>.
Sorry I read that wrong... I thought all keys were the same "should
probably be wearing my glasses" it looks like its sorting normally... The
second column is ascending in value as you'd expect
On Jul 1, 2013 1:11 PM, "Robert Newson" <rn...@apache.org> 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 <si...@gmail.com> 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" <ra...@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
> >>
>
Re: How to sort this view
Posted by Robert Newson <rn...@apache.org>.
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 <si...@gmail.com> 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" <ra...@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
>>
Re: How to sort this view
Posted by Stanley Iriele <si...@gmail.com>.
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" <ra...@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
>