summaryrefslogtreecommitdiff
path: root/src/couchdb
diff options
context:
space:
mode:
authorFilipe David Borba Manana <fdmanana@apache.org>2010-11-19 12:19:38 +0000
committerFilipe David Borba Manana <fdmanana@apache.org>2010-11-19 12:19:38 +0000
commitaae8762c1560a110f11fa8f2524018f20504e40d (patch)
treecc42b94104e7c846f4c1c6672300daf0e8539684 /src/couchdb
parent1074767a6b2a254fc6abcb08ec8ccc156e5aa6e9 (diff)
Add aliases start_key, end_key, start_key_docid and end_key_docid.
Closes COUCHDB-949. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1036813 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb')
-rw-r--r--src/couchdb/couch_httpd_view.erl18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/couchdb/couch_httpd_view.erl b/src/couchdb/couch_httpd_view.erl
index 35cf5b04..5ac73af3 100644
--- a/src/couchdb/couch_httpd_view.erl
+++ b/src/couchdb/couch_httpd_view.erl
@@ -269,14 +269,26 @@ parse_view_param("", _) ->
parse_view_param("key", Value) ->
JsonKey = ?JSON_DECODE(Value),
[{start_key, JsonKey}, {end_key, JsonKey}];
+% TODO: maybe deprecate startkey_docid
parse_view_param("startkey_docid", Value) ->
[{start_docid, ?l2b(Value)}];
+parse_view_param("start_key_docid", Value) ->
+ [{start_docid, ?l2b(Value)}];
+% TODO: maybe deprecate endkey_docid
parse_view_param("endkey_docid", Value) ->
[{end_docid, ?l2b(Value)}];
+parse_view_param("end_key_docid", Value) ->
+ [{end_docid, ?l2b(Value)}];
+% TODO: maybe deprecate startkey
parse_view_param("startkey", Value) ->
[{start_key, ?JSON_DECODE(Value)}];
+parse_view_param("start_key", Value) ->
+ [{start_key, ?JSON_DECODE(Value)}];
+% TODO: maybe deprecate endkey
parse_view_param("endkey", Value) ->
[{end_key, ?JSON_DECODE(Value)}];
+parse_view_param("end_key", Value) ->
+ [{end_key, ?JSON_DECODE(Value)}];
parse_view_param("limit", Value) ->
[{limit, parse_positive_int_param(Value)}];
parse_view_param("count", _Value) ->
@@ -325,10 +337,12 @@ warn_on_empty_key_range(#view_query_args{
case {Dir, couch_view:less_json(StartKey, EndKey)} of
{fwd, false} ->
throw({query_parse_error,
- <<"No rows can match your key range, reverse your startkey and endkey or set descending=true">>});
+ <<"No rows can match your key range, reverse your ",
+ "start_key and end_key or set descending=true">>});
{rev, true} ->
throw({query_parse_error,
- <<"No rows can match your key range, reverse your startkey and endkey or set descending=false">>});
+ <<"No rows can match your key range, reverse your ",
+ "start_key and end_key or set descending=false">>});
_ -> ok
end.