diff options
author | John Christopher Anderson <jchris@apache.org> | 2009-01-23 00:53:05 +0000 |
---|---|---|
committer | John Christopher Anderson <jchris@apache.org> | 2009-01-23 00:53:05 +0000 |
commit | 0a46c330072a3811d98a5c989d4c6486cff83df2 (patch) | |
tree | c3eaab8bc703fd0b4c375d70efb1eea42d68a1ed /src/couchdb/couch_httpd_db.erl | |
parent | 3e12deff5c0f87eefcd3de8dbf93a9724e98258e (diff) |
View list functions can stream views in any format. See list_views test for details.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@736876 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_httpd_db.erl')
-rw-r--r-- | src/couchdb/couch_httpd_db.erl | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/couchdb/couch_httpd_db.erl b/src/couchdb/couch_httpd_db.erl index c7c9ec15..9ef7387c 100644 --- a/src/couchdb/couch_httpd_db.erl +++ b/src/couchdb/couch_httpd_db.erl @@ -192,7 +192,9 @@ db_req(#httpd{method='GET',path_parts=[_,<<"_all_docs_by_seq">>]}=Req, Db) -> TotalRowCount = proplists:get_value(doc_count, Info), FoldlFun = couch_httpd_view:make_view_fold_fun(Req, QueryArgs, Db, - TotalRowCount, fun couch_db:enum_docs_since_reduce_to_count/1), + TotalRowCount, #view_fold_helper_funs{ + reduce_count = fun couch_db:enum_docs_since_reduce_to_count/1 + }), StartKey2 = case StartKey of nil -> 0; <<>> -> 100000000000; @@ -306,7 +308,10 @@ all_docs_view(Req, Db, Keys) -> case Keys of nil -> FoldlFun = couch_httpd_view:make_view_fold_fun(Req, QueryArgs, Db, - TotalRowCount, fun couch_db:enum_docs_reduce_to_count/1, PassedEndFun), + TotalRowCount, #view_fold_helper_funs{ + reduce_count = fun couch_db:enum_docs_reduce_to_count/1, + passed_end = PassedEndFun + }), AdapterFun = fun(#full_doc_info{id=Id}=FullDocInfo, Offset, Acc) -> case couch_doc:to_doc_info(FullDocInfo) of #doc_info{deleted=false, rev=Rev} -> @@ -320,7 +325,9 @@ all_docs_view(Req, Db, Keys) -> couch_httpd_view:finish_view_fold(Req, TotalRowCount, {ok, FoldResult}); _ -> FoldlFun = couch_httpd_view:make_view_fold_fun(Req, QueryArgs, Db, - TotalRowCount, fun(Offset) -> Offset end), + TotalRowCount, #view_fold_helper_funs{ + reduce_count = fun(Offset) -> Offset end + }), KeyFoldFun = case Dir of fwd -> fun lists:foldl/3; |