couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karel Minařík (JIRA) <>
Subject [jira] Updated: (COUCHDB-599) `head.total_rows` returns empty in a _list function
Date Thu, 17 Dec 2009 12:50:19 GMT


Karel Minařík updated COUCHDB-599:

    Comment: was deleted

(was: This issue is INVALID:

head.total_rows is available only for views without reduce() function OR when `?reduce=false`
is specified. (#couchdb> rnewson: We don't know up-front how many rows will remain after
a reduce.)

The attached test fails because a list function needs to execute both send() AND return.

(I think it would be helpful to un-comment the tests for `head.total_rows` in test suite (list_views.js),
so it's transparent for other who may be hit by this.)

Thanks to Robert Newson for helping me to figure and sort this out!


> `head.total_rows` returns empty in a _list function
> ---------------------------------------------------
>                 Key: COUCHDB-599
>                 URL:
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Database Core, Test Suite
>    Affects Versions: 0.10, 0.11
>         Environment: Mac OS X 10.5.8, Mac Book Air, CouchDB 0.10.0 (mac ports) and trunk
>            Reporter: Karel Minařík
> In a _list function defined like this:
>   function (head, req) {
>     return 'Total: ' + head.total_rows;
>   }
> the `head.total_rows` is undefined. 
> I have created a test case for the issue in this patch (against Git repo at
> -->
> See the map/reduce and list function definition in the gist, also the full db dump is
> This fails for me on CouchDB 0.10.0 and 0.11.0b77473d79-git.
> There are tests for `head.total_rows` commented out in the test cases (list_views.js,

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message