Use map/reduce with a simple sum function. Then the number will always be available.
On Fri, Jun 22, 2012 at 6:17 AM, Daniel Gonzalez <[email protected]>wrote: > On Fri, Jun 22, 2012 at 2:05 PM, Dave Cottlehuber <[email protected]> > wrote: > > > > > Either its retrieving all documents, or the view is being built while you > > wait. > > > > Add limit=0 to your view parameters, to address the first issue. > > > > I guess you want to know the current # of documents, so if the view > > hasn't been built yet, or needs updating you will need to wait. If you > > are OK with an older result then you can use stale=ok. > > > > A+ > > Dave > > > > Thanks, the limit=0 parameter is working. I thought that putting a limit > parameter would affect the total_rows parameter returned by the view. I see > now that total_rows refers to the number of documents in the view, not just > the returned ones. Which makes sense, obviously. I was just very confused. >
