Return total index rows

Fixes: COUCHDB-2652


Project: http://git-wip-us.apache.org/repos/asf/couchdb-mango/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-mango/commit/0deb8d13
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-mango/tree/0deb8d13
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-mango/diff/0deb8d13

Branch: refs/heads/2652-index-pagination
Commit: 0deb8d1310c5541cf5ba7d2d75ef5d7005218abf
Parents: d128f16
Author: Tony Sun <tony....@cloudant.com>
Authored: Mon Apr 20 10:14:33 2015 -0700
Committer: Tony Sun <tony....@cloudant.com>
Committed: Mon Apr 20 10:14:33 2015 -0700

----------------------------------------------------------------------
 src/mango_httpd.erl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/0deb8d13/src/mango_httpd.erl
----------------------------------------------------------------------
diff --git a/src/mango_httpd.erl b/src/mango_httpd.erl
index 3d98535..69e0296 100644
--- a/src/mango_httpd.erl
+++ b/src/mango_httpd.erl
@@ -70,7 +70,7 @@ handle_index_req(#httpd{method='GET', path_parts=[_, _]}=Req, 
Db) ->
             Skip0
     end,
     JsonIdxs = lists:sublist(JsonIdxs0, Skip+1, Limit),
-       chttpd:send_json(Req, {[{indexes, JsonIdxs}]});
+       chttpd:send_json(Req, {[{total_rows, TotalRows}, {indexes, JsonIdxs}]});
 
 handle_index_req(#httpd{method='POST', path_parts=[_, _]}=Req, Db) ->
     {ok, Opts} = mango_opts:validate_idx_create(chttpd:json_body_obj(Req)),

Reply via email to