summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_httpd_view.erl
diff options
context:
space:
mode:
authorFilipe David Borba Manana <fdmanana@apache.org>2010-09-27 19:14:37 +0000
committerFilipe David Borba Manana <fdmanana@apache.org>2010-09-27 19:14:37 +0000
commit6c6db011c2064597526c6f36878a282238dd2bf2 (patch)
tree9875a3237a385b3ff9d9f53be7642bafbabcbbfa /src/couchdb/couch_httpd_view.erl
parentc4e2e1416bcedbe654d56c3851a0d08cddfc4bee (diff)
Replacing calls to couch_util:get_value with ?getv
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1001879 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_httpd_view.erl')
-rw-r--r--src/couchdb/couch_httpd_view.erl16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/couchdb/couch_httpd_view.erl b/src/couchdb/couch_httpd_view.erl
index 65598a68..cecbf8c0 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 couch_util:get_value(<<"keys">>, Fields, nil) of
+ case ?getv(<<"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 = 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),
+ Language = ?getv(<<"language">>, Props, <<"javascript">>),
+ {DesignOptions} = ?getv(<<"options">>, Props, {[]}),
+ MapSrc = ?getv(<<"map">>, Props),
+ Keys = ?getv(<<"keys">>, Props, nil),
Reduce = get_reduce_type(Req),
- case couch_util:get_value(<<"reduce">>, Props, null) of
+ case ?getv(<<"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 couch_util:get_value(<<"_rev">>, Props) of
+ Rev = case ?getv(<<"_rev">>, Props) of
undefined ->
nil;
Rev0 ->
couch_doc:parse_rev(Rev0)
end,
- IncludeId = couch_util:get_value(<<"_id">>, Props, DocId),
+ IncludeId = ?getv(<<"_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});