couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Newson <rnew...@apache.org>
Subject Re: view used startkey & endkey problem
Date Mon, 25 Nov 2013 22:32:21 GMT
Views can be used to look up a specific key or a contiguous range of
keys, the original poster is wrong to think that each item in the view
is separately queryable.

That said, [600,69] is greater than [400,50] and less than [1000, 100]
and so should be returned, even in 1.0.4.

B.


On 25 November 2013 22:16, Andy Wenk <andy@nms.de> wrote:
> I am not sure how it was in old 1.0.4. But is it a problem to upgrade to
> 1.5? 1.0.4 is really outdated ...
>
>
> On 25 November 2013 15:51, Qaqabincs <lujing7@gmail.com> wrote:
>
>> hi, all,
>>
>> I use couchdb-1.0.4, and I use a design view:
>>
>> findBoys:{
>> map:function(doc) {
>> if(doc.boy){
>> emit([doc.boy.height,doc.boy.weight],doc);
>> };
>> }
>> }
>>
>> if I query this view via Futon, there are 13 boys on list, but if I set
>> a range to this view, such as:
>> http://localhost:5984/repos/_design/namelist/_view/findBoys?startkey=[400,
>> 50]&endkey=[1000, 100]
>> couchdb return me a result like:
>> {"total_rows":13,"offset":13,"rows":[]}
>> but there at least a boy whose height=600 & weight=69 !
>>
>> and, when I use couchdb-1.5.0, the view work all right, it can return
>> the exact data.
>>
>> is the "startkey & endkey" not supported by couchdb-1.0.4? or I use a
>> mistake syntax?
>>
>>
>>
>> Qaqabincs
>>
>
>
>
> --
> Andy Wenk
> Hamburg - Germany
> RockIt!
>
> http://www.couchdb-buch.de
> http://www.pg-praxisbuch.de
>
> GPG fingerprint: C044 8322 9E12 1483 4FEC 9452 B65D 6BE3 9ED3 9588

Mime
View raw message