couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Patrick Aljord" <patc...@gmail.com>
Subject how do I get the total number of rows returned for a given key?
Date Mon, 25 Aug 2008 04:59:42 GMT
Hey all,

I'm trying to get the number of docs returned by my view given a
certain key such as:

myview?key=foo&count=0

I thought total_rows would give the numbers of docs that have this
specific key but instead it gave me the total rows for all keys. I was
told by "jeffd" on IRC this is the normal behavior but, I quote:

"there was talk in this channel at some point of adding another piece,
but I dunno how far that went".

So my question is: are you going to add another piece like total_rows
but that would return the number of rows for a given key? Or is there
a better way to do so? (with reduce I guess, but still it would be
nice to have it included). This is really needed for pagination.
I spotted an issue for that https://issues.apache.org/jira/browse/COUCHDB-82


Thanks in advance,

Pat

Mime
View raw message