incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Hahn <m...@elleh.com>
Subject Re: wrong view results?
Date Wed, 09 Feb 2011 23:17:35 GMT
BTW:  I had the first and last numbers reversed with the smaller one
first, even though I was using descending=true.  I fixed this but it
didn't change the results.

On Wed, Feb 9, 2011 at 2:52 PM, Mark Hahn <mark@elleh.com> wrote:
> I'm getting what seems to me to be the wrong view results.  Of course
> if I am doing something wrong it would be no surprise.
>
> I have a view called itemByEmailNum.  Here is the definition of the view ...
>
> function(doc) {
>  if(doc.type == 'item')
>    emit([doc.email, doc.itemNumber], null);
>
> Here is what I get from that view with no keys specified.
>
> {"total_rows":2,"offset":0,"rows":[
> {"id":"86d5d83c65c3d901e29c7567be001233","key":["root",12],"value":null},
> {"id":"86d5d83c65c3d901e29c7567be001e68","key":["root",13],"value":null}
> ]}
>
> Here is the url of the view that seems to give the wrong results.
> I've added spaces here for clarity.
>
> /bb/_design/bb/_view/itemByEmailNum ? keystart=susan%40elleh.com, 0 &
> keyend=susan%40elleh.com, 1000000000 & include_docs=true &
> descending=true
>
> This should not have gotten any results since the only docs have the
> first key of "root" and both the keystart and keyend in this request
> have a first key of susan%40elleh.com.  Here are the results it
> returned.  I've snipped the doc properties for clarity.
>
> {"total_rows":2,"offset":0,"rows":[
> {"id":"86d5d83c65c3d901e29c7567be001e68","key":["root",13],"value":null,"doc":{
> ... }},
> {"id":"86d5d83c65c3d901e29c7567be001233","key":["root",12],"value":null,"doc":{
> ... }}
> ]}
>
> Any help would be appreciated.  I'm using CouchDB 1.0.1.
>

Mime
View raw message