couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hank Knight <hknight...@gmail.com>
Subject Re: Strange values for "total_rows" and "offset"
Date Tue, 15 Oct 2013 19:19:56 GMT
I would highly recommend and appropriate making total_rows and offset optional.

Ideally you would be able to control it like this:
http://example.com/abc/_design/iws/_view/q?key=%GOLD%22&pagination=false




On Tue, Oct 15, 2013 at 3:51 PM, Robert Newson <rnewson@apache.org> wrote:
>
> Near zero, I'd say. The number is not cheaply computable with structures as they are.
I would be ok with removing total_rows and offset from the output given that they're a bit
silly, really.
>
> On 15 Oct 2013, at 19:05, Hank Knight <hknight555@gmail.com> wrote:
>
>> What are the chances of this feature being added to future releases of
>> CouchDB? I am sure it would benefit many.
>>
>>
>> On Tue, Oct 15, 2013 at 10:19 AM, Robert Newson <rnewson@apache.org> wrote:
>>
>>>
>>> Sadly not.
>>>
>>> On 15 Oct 2013, at 13:56, Hank Knight <hknight555@gmail.com> wrote:
>>>
>>>> I need the total rows matching my query so I can do proper pagination
>>> based
>>>> on a query.  Is this possible?
>>>>
>>>>
>>>> On Tue, Oct 15, 2013 at 9:42 AM, Robert Newson <rnewson@apache.org>
>>> wrote:
>>>>
>>>>> total_rows is the total number of rows in the view, not that match your
>>>>> query.
>>>>>
>>>>> B.
>>>>>
>>>>> On 15 Oct 2013, at 13:38, Hank Knight <hknight555@gmail.com> wrote:
>>>>>
>>>>>> There are only 10 matching results where the key is "GOLD":
>>>>>> http://example.com/abc/_design/iws/_view/q?key=%GOLD%22
>>>>>>
>>>>>> However the first line of the response is this:
>>>>>>
>>>>>> {"total_rows":52340,"offset":218,"rows":[
>>>>>>
>>>>>> Why doesn't it say this?
>>>>>>
>>>>>> {"total_rows":10,"offset":0,"rows":[
>>>>>>
>>>>>> The problem is that when I limit results like this:
>>>>>>
>>>>>> http://example.com/abc/_design/iws/_view/q?key=%GOLD%22&limit=5&skip=0
>>>>>>
>>>>>> I cannot tell from the response if that response includes all matches
>>> or
>>>>>> only the first five.
>>>>>
>>>>>
>>>
>>>
>

Mime
View raw message