You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Matteo Caprari <ma...@gmail.com> on 2009/12/16 23:44:40 UTC
_list function total_rows parameter always reports full view size?
Hi!
I was trying to use head.total_rows inside a _list function, expecting
to find there
the number of rows that I'll find in the iterator.
I was puzzled to find that instead it always reports the full size of
the view being listed, evem if I limit
the view to a single key
{"total_rows": 37,"offset": null}
Is this teh expected behviour?
If so, what's a good way to know how many rows will the iterator return?
Thanks :)
--
:Matteo Caprari
matteo.caprari@gmail.com
Re: _list function total_rows parameter always reports full view
size?
Posted by Paul Davis <pa...@gmail.com>.
> {"total_rows": 37,"offset": null}
>
> Is this teh expected behviour?
Yes, total rows is the number of rows in the view.
> If so, what's a good way to know how many rows will the iterator return?
There's no way to tell that inside the list itself. The easiest way to
get the number of rows between any two arbitrary keys is to use a row
count reduce.
HTH,
Paul Davis