From cdfe55c54de515581121f6923e8301e8cbea5bcc Mon Sep 17 00:00:00 2001 From: John Christopher Anderson Date: Sun, 1 Feb 2009 22:21:09 +0000 Subject: Added options member to design docs. Currently the only option is include_designs (views can now run over design docs as well if they need to), the default is false, which is the current behavior. Thanks davisp for the original patch. Closes COUCHDB-156 git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@739866 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_httpd_view.erl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/couchdb/couch_httpd_view.erl') diff --git a/src/couchdb/couch_httpd_view.erl b/src/couchdb/couch_httpd_view.erl index 0d5c0df4..fc3302d7 100644 --- a/src/couchdb/couch_httpd_view.erl +++ b/src/couchdb/couch_httpd_view.erl @@ -68,15 +68,17 @@ handle_temp_view_req(#httpd{method='POST'}=Req, Db) -> end, {Props} = couch_httpd:json_body(Req), Language = proplists:get_value(<<"language">>, Props, <<"javascript">>), + {DesignOptions} = proplists:get_value(<<"options">>, Props, {[]}), MapSrc = proplists:get_value(<<"map">>, Props), Keys = proplists:get_value(<<"keys">>, Props, nil), case proplists:get_value(<<"reduce">>, Props, null) of null -> - {ok, View} = couch_view:get_temp_map_view(Db, Language, MapSrc), + {ok, View} = couch_view:get_temp_map_view(Db, Language, + DesignOptions, MapSrc), output_map_view(Req, View, Db, QueryArgs, Keys); RedSrc -> - {ok, View} = couch_view:get_temp_reduce_view(Db, Language, MapSrc, - RedSrc), + {ok, View} = couch_view:get_temp_reduce_view(Db, Language, + DesignOptions, MapSrc, RedSrc), output_reduce_view(Req, View, QueryArgs, Keys) end; -- cgit v1.2.3