couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Gonzalez <gonva...@gonvaled.com>
Subject Re: Get total number of documents in view, without getting all documents
Date Fri, 22 Jun 2012 13:17:13 GMT
On Fri, Jun 22, 2012 at 2:05 PM, Dave Cottlehuber <dave@muse.net.nz> 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.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message