From 5ad12f26e8288a0bc4ae061b9c2f0465d1ada95d Mon Sep 17 00:00:00 2001 From: Christopher Lenz Date: Thu, 10 Dec 2009 13:27:42 +0000 Subject: Add a "Reduce" checkbox to the database view page in Futon, which controls the `reduce=true|false` query string parameter. I had to add `reduce=false` support for temp views on the server side to make the feature not-confusing. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@889256 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_httpd_view.erl | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/couchdb') diff --git a/src/couchdb/couch_httpd_view.erl b/src/couchdb/couch_httpd_view.erl index af91b654..af31ac9c 100644 --- a/src/couchdb/couch_httpd_view.erl +++ b/src/couchdb/couch_httpd_view.erl @@ -124,12 +124,18 @@ handle_temp_view_req(#httpd{method='POST'}=Req, Db) -> {DesignOptions} = proplists:get_value(<<"options">>, Props, {[]}), MapSrc = proplists:get_value(<<"map">>, Props), Keys = proplists:get_value(<<"keys">>, Props, nil), + Reduce = get_reduce_type(Req), case proplists:get_value(<<"reduce">>, Props, null) of null -> QueryArgs = parse_view_params(Req, Keys, map), {ok, View, Group} = couch_view:get_temp_map_view(Db, Language, DesignOptions, MapSrc), output_map_view(Req, View, Group, Db, QueryArgs, Keys); + _ when Reduce =:= false -> + QueryArgs = parse_view_params(Req, Keys, red_map), + {ok, View, Group} = couch_view:get_temp_map_view(Db, Language, + DesignOptions, MapSrc), + output_map_view(Req, View, Group, Db, QueryArgs, Keys); RedSrc -> QueryArgs = parse_view_params(Req, Keys, reduce), {ok, View, Group} = couch_view:get_temp_reduce_view(Db, Language, -- cgit v1.2.3