diff options
author | Filipe David Borba Manana <fdmanana@apache.org> | 2010-09-30 12:03:15 +0000 |
---|---|---|
committer | Filipe David Borba Manana <fdmanana@apache.org> | 2010-09-30 12:03:15 +0000 |
commit | 6ae13b5f8b827bc87a8cf3306c3caa1b97e49df3 (patch) | |
tree | 9662164348a314705094f5f52456ab7bfe330df9 /src/couchdb/couch_httpd_view.erl | |
parent | 1c0a6e9c637fcfec2990c6318b3c69e4c7591d76 (diff) |
Removing ?getv macros.
With OTP releases up to R13B03 it's not possible to define a 2 macro functions with the same name and different arities.
(Only allowed in R13B04 and R14).
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1003025 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_httpd_view.erl')
-rw-r--r-- | src/couchdb/couch_httpd_view.erl | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/couchdb/couch_httpd_view.erl b/src/couchdb/couch_httpd_view.erl index cecbf8c0..65598a68 100644 --- a/src/couchdb/couch_httpd_view.erl +++ b/src/couchdb/couch_httpd_view.erl @@ -63,7 +63,7 @@ handle_view_req(#httpd{method='POST', path_parts=[_, _, DName, _, ViewName]}=Req, Db, _DDoc) -> couch_httpd:validate_ctype(Req, "application/json"), {Fields} = couch_httpd:json_body_obj(Req), - case ?getv(<<"keys">>, Fields, nil) of + case couch_util:get_value(<<"keys">>, Fields, nil) of nil -> Fmt = "POST to view ~p/~p in database ~p with no keys member.", ?LOG_DEBUG(Fmt, [DName, ViewName, Db]), @@ -82,12 +82,12 @@ handle_temp_view_req(#httpd{method='POST'}=Req, Db) -> ok = couch_db:check_is_admin(Db), couch_stats_collector:increment({httpd, temporary_view_reads}), {Props} = couch_httpd:json_body_obj(Req), - Language = ?getv(<<"language">>, Props, <<"javascript">>), - {DesignOptions} = ?getv(<<"options">>, Props, {[]}), - MapSrc = ?getv(<<"map">>, Props), - Keys = ?getv(<<"keys">>, Props, nil), + Language = couch_util:get_value(<<"language">>, Props, <<"javascript">>), + {DesignOptions} = couch_util:get_value(<<"options">>, Props, {[]}), + MapSrc = couch_util:get_value(<<"map">>, Props), + Keys = couch_util:get_value(<<"keys">>, Props, nil), Reduce = get_reduce_type(Req), - case ?getv(<<"reduce">>, Props, null) of + case couch_util: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, @@ -623,13 +623,13 @@ view_row_obj(_Db, {{Key, error}, Value}, _IncludeDocs) -> {[{key, Key}, {error, Value}]}; % include docs in the view output view_row_obj(Db, {{Key, DocId}, {Props}}, true) -> - Rev = case ?getv(<<"_rev">>, Props) of + Rev = case couch_util:get_value(<<"_rev">>, Props) of undefined -> nil; Rev0 -> couch_doc:parse_rev(Rev0) end, - IncludeId = ?getv(<<"_id">>, Props, DocId), + IncludeId = couch_util:get_value(<<"_id">>, Props, DocId), view_row_with_doc(Db, {{Key, DocId}, {Props}}, {IncludeId, Rev}); view_row_obj(Db, {{Key, DocId}, Value}, true) -> view_row_with_doc(Db, {{Key, DocId}, Value}, {DocId, nil}); |