incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Kocoloski <kocol...@apache.org>
Subject Re: How get results in reversed order by date and without id field (stackoverflow)
Date Mon, 05 May 2014 19:26:33 GMT
Indeed, it may be a bit quirky but if you do what it asks you should get what you're looking
for:

> myview?startkey=["3566120224",{}]&endkey=["3566120224"]&descending=true

That is, CouchDB always wants to start the traversal at the start key and finish at the end
key. If you're supplying descending=true, that means the start key must sort _after_ the end
key.

Adam

On May 5, 2014, at 3:19 PM, Nicolas Palacios <npalacios91@gmail.com> wrote:

> Hi Jens, thanks for your comment.
> 
> But if I try with:
> myview?startkey=["3566120224"]&endkey=["3566120224",{}]&descending=true
> 
> I get this error:
> 
> {"error":"query_parse_error","reason":"No rows can match your key
> range, reverse your start_key and end_key or set descending=false"}
> 
> I'm lost..... with it, also I want exclude the id field in order to
> get a shortest json result.
> 
> 
> 
> 2014-05-05 15:09 GMT-04:00 Jens Alfke <jens@couchbase.com>:
> 
>> 
>> On May 5, 2014, at 11:53 AM, Nicolas Palacios <npalacios91@gmail.com>
>> wrote:
>> 
>>>   myview?startkey=["3566120224"]&endkey=["3566120224",{}]&reversed=true
>> 
>> It’s “descending”, not “reversed”.
>> Docs are here: http://docs.couchdb.org/en/latest/api/ddoc/views.html
>> 
>> —Jens


Mime
View raw message