You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Mark Hahn <ma...@elleh.com> on 2011/02/09 23:52:58 UTC

wrong view results?

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.

Re: wrong view results?

Posted by Mark Hahn <ma...@elleh.com>.
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 <ma...@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.
>

Re: wrong view results?

Posted by Anup Bishnoi <pi...@gmail.com>.
oh. ok
thanks

On Thu, Feb 10, 2011 at 9:38 PM, Mark Hahn <ma...@elleh.com> wrote:

> I don't think so.  I didn't generate the URL, jquery.couch.js did.  It
> works fine.
>
> On Thu, Feb 10, 2011 at 7:17 AM, Anup Bishnoi <pi...@gmail.com>
> wrote:
> > also i think you'll have to put square brackets around the start and end
> key
> > values in the url.
> >
> > On Thu, Feb 10, 2011 at 6:53 AM, Mark Hahn <ma...@elleh.com> wrote:
> >
> >> I didn't have startkey or start_key.  I had keystart (duh).  Thanks
> >> for pointing me in the right direction.
> >>
> >> On Wed, Feb 9, 2011 at 4:46 PM, Javier Julio <jj...@gmail.com>
> wrote:
> >> > It looked odd to me at first too and I just happened to have that page
> >> open. Glad I checked. Yeah makes sense its used a lot. Nice that either
> one
> >> will be supported!
> >> >
> >> > Are you getting the correct results now Mark? Let us know.
> >> >
> >> > On Feb 9, 2011, at 7:42 PM, Paul Davis wrote:
> >> >
> >> >> On Wed, Feb 9, 2011 at 7:37 PM, Javier Julio <jj...@gmail.com>
> >> wrote:
> >> >>> No it should be "startkey" and "endkey" (no underscores, has to be
> all
> >> lowercase otherwise not recognized).
> >> http://wiki.apache.org/couchdb/HTTP_view_API
> >> >>>
> >> >>> On Feb 9, 2011, at 7:31 PM, Paul Davis wrote:
> >> >>>
> >> >>>> On Wed, Feb 9, 2011 at 5:52 PM, Mark Hahn <ma...@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.
> >> >>>>>
> >> >>>>
> >> >>>> keystart and keyend should be start_key and end_key.
> >> >>>
> >> >>>
> >> >>
> >> >> Ah right. Older versions are still on the no underscore version.
> 1.1.0
> >> >> and beyond will recognize both because people tend to add the
> >> >> underscore.
> >> >
> >> >
> >>
> >
>

Re: wrong view results?

Posted by Mark Hahn <ma...@elleh.com>.
I don't think so.  I didn't generate the URL, jquery.couch.js did.  It
works fine.

On Thu, Feb 10, 2011 at 7:17 AM, Anup Bishnoi <pi...@gmail.com> wrote:
> also i think you'll have to put square brackets around the start and end key
> values in the url.
>
> On Thu, Feb 10, 2011 at 6:53 AM, Mark Hahn <ma...@elleh.com> wrote:
>
>> I didn't have startkey or start_key.  I had keystart (duh).  Thanks
>> for pointing me in the right direction.
>>
>> On Wed, Feb 9, 2011 at 4:46 PM, Javier Julio <jj...@gmail.com> wrote:
>> > It looked odd to me at first too and I just happened to have that page
>> open. Glad I checked. Yeah makes sense its used a lot. Nice that either one
>> will be supported!
>> >
>> > Are you getting the correct results now Mark? Let us know.
>> >
>> > On Feb 9, 2011, at 7:42 PM, Paul Davis wrote:
>> >
>> >> On Wed, Feb 9, 2011 at 7:37 PM, Javier Julio <jj...@gmail.com>
>> wrote:
>> >>> No it should be "startkey" and "endkey" (no underscores, has to be all
>> lowercase otherwise not recognized).
>> http://wiki.apache.org/couchdb/HTTP_view_API
>> >>>
>> >>> On Feb 9, 2011, at 7:31 PM, Paul Davis wrote:
>> >>>
>> >>>> On Wed, Feb 9, 2011 at 5:52 PM, Mark Hahn <ma...@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.
>> >>>>>
>> >>>>
>> >>>> keystart and keyend should be start_key and end_key.
>> >>>
>> >>>
>> >>
>> >> Ah right. Older versions are still on the no underscore version. 1.1.0
>> >> and beyond will recognize both because people tend to add the
>> >> underscore.
>> >
>> >
>>
>

Re: wrong view results?

Posted by Anup Bishnoi <pi...@gmail.com>.
also i think you'll have to put square brackets around the start and end key
values in the url

On Thu, Feb 10, 2011 at 6:53 AM, Mark Hahn <ma...@elleh.com> wrote:

> I didn't have startkey or start_key.  I had keystart (duh).  Thanks
> for pointing me in the right direction.
>
> On Wed, Feb 9, 2011 at 4:46 PM, Javier Julio <jj...@gmail.com> wrote:
> > It looked odd to me at first too and I just happened to have that page
> open. Glad I checked. Yeah makes sense its used a lot. Nice that either one
> will be supported!
> >
> > Are you getting the correct results now Mark? Let us know.
> >
> > On Feb 9, 2011, at 7:42 PM, Paul Davis wrote:
> >
> >> On Wed, Feb 9, 2011 at 7:37 PM, Javier Julio <jj...@gmail.com>
> wrote:
> >>> No it should be "startkey" and "endkey" (no underscores, has to be all
> lowercase otherwise not recognized).
> http://wiki.apache.org/couchdb/HTTP_view_API
> >>>
> >>> On Feb 9, 2011, at 7:31 PM, Paul Davis wrote:
> >>>
> >>>> On Wed, Feb 9, 2011 at 5:52 PM, Mark Hahn <ma...@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.
> >>>>>
> >>>>
> >>>> keystart and keyend should be start_key and end_key.
> >>>
> >>>
> >>
> >> Ah right. Older versions are still on the no underscore version. 1.1.0
> >> and beyond will recognize both because people tend to add the
> >> underscore.
> >
> >
>

Re: wrong view results?

Posted by Mark Hahn <ma...@elleh.com>.
I didn't have startkey or start_key.  I had keystart (duh).  Thanks
for pointing me in the right direction.

On Wed, Feb 9, 2011 at 4:46 PM, Javier Julio <jj...@gmail.com> wrote:
> It looked odd to me at first too and I just happened to have that page open. Glad I checked. Yeah makes sense its used a lot. Nice that either one will be supported!
>
> Are you getting the correct results now Mark? Let us know.
>
> On Feb 9, 2011, at 7:42 PM, Paul Davis wrote:
>
>> On Wed, Feb 9, 2011 at 7:37 PM, Javier Julio <jj...@gmail.com> wrote:
>>> No it should be "startkey" and "endkey" (no underscores, has to be all lowercase otherwise not recognized). http://wiki.apache.org/couchdb/HTTP_view_API
>>>
>>> On Feb 9, 2011, at 7:31 PM, Paul Davis wrote:
>>>
>>>> On Wed, Feb 9, 2011 at 5:52 PM, Mark Hahn <ma...@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.
>>>>>
>>>>
>>>> keystart and keyend should be start_key and end_key.
>>>
>>>
>>
>> Ah right. Older versions are still on the no underscore version. 1.1.0
>> and beyond will recognize both because people tend to add the
>> underscore.
>
>

Re: wrong view results?

Posted by Javier Julio <jj...@gmail.com>.
It looked odd to me at first too and I just happened to have that page open. Glad I checked. Yeah makes sense its used a lot. Nice that either one will be supported!

Are you getting the correct results now Mark? Let us know.

On Feb 9, 2011, at 7:42 PM, Paul Davis wrote:

> On Wed, Feb 9, 2011 at 7:37 PM, Javier Julio <jj...@gmail.com> wrote:
>> No it should be "startkey" and "endkey" (no underscores, has to be all lowercase otherwise not recognized). http://wiki.apache.org/couchdb/HTTP_view_API
>> 
>> On Feb 9, 2011, at 7:31 PM, Paul Davis wrote:
>> 
>>> On Wed, Feb 9, 2011 at 5:52 PM, Mark Hahn <ma...@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.
>>>> 
>>> 
>>> keystart and keyend should be start_key and end_key.
>> 
>> 
> 
> Ah right. Older versions are still on the no underscore version. 1.1.0
> and beyond will recognize both because people tend to add the
> underscore.


Re: wrong view results?

Posted by Paul Davis <pa...@gmail.com>.
On Wed, Feb 9, 2011 at 7:37 PM, Javier Julio <jj...@gmail.com> wrote:
> No it should be "startkey" and "endkey" (no underscores, has to be all lowercase otherwise not recognized). http://wiki.apache.org/couchdb/HTTP_view_API
>
> On Feb 9, 2011, at 7:31 PM, Paul Davis wrote:
>
>> On Wed, Feb 9, 2011 at 5:52 PM, Mark Hahn <ma...@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.
>>>
>>
>> keystart and keyend should be start_key and end_key.
>
>

Ah right. Older versions are still on the no underscore version. 1.1.0
and beyond will recognize both because people tend to add the
underscore.

Re: wrong view results?

Posted by Javier Julio <jj...@gmail.com>.
No it should be "startkey" and "endkey" (no underscores, has to be all lowercase otherwise not recognized). http://wiki.apache.org/couchdb/HTTP_view_API

On Feb 9, 2011, at 7:31 PM, Paul Davis wrote:

> On Wed, Feb 9, 2011 at 5:52 PM, Mark Hahn <ma...@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.
>> 
> 
> keystart and keyend should be start_key and end_key.


Re: wrong view results?

Posted by Paul Davis <pa...@gmail.com>.
On Wed, Feb 9, 2011 at 5:52 PM, Mark Hahn <ma...@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.
>

keystart and keyend should be start_key and end_key.