summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_httpd_view.erl
diff options
context:
space:
mode:
authorJohn Christopher Anderson <jchris@apache.org>2009-02-01 22:21:09 +0000
committerJohn Christopher Anderson <jchris@apache.org>2009-02-01 22:21:09 +0000
commitcdfe55c54de515581121f6923e8301e8cbea5bcc (patch)
tree13db216a91aa8ad0f39d30324afa41023334b685 /src/couchdb/couch_httpd_view.erl
parent614f3c26d98ab656e095b5672511d710732f034a (diff)
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
Diffstat (limited to 'src/couchdb/couch_httpd_view.erl')
-rw-r--r--src/couchdb/couch_httpd_view.erl8
1 files changed, 5 insertions, 3 deletions
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;