summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Newson <rnewson@apache.org>2018-07-09 23:16:45 +0100
committerRobert Newson <rnewson@apache.org>2018-07-10 15:30:14 +0100
commit002e04c063c1bfe142dae9dcaa33d0adae2d7ae4 (patch)
tree2e4d4cdb4d6ae1c1a2362846d6bfdd1ed4367c4f
parent67de50068795da8d44855e12e5af03392e292132 (diff)
downloadcouchdb-002e04c063c1bfe142dae9dcaa33d0adae2d7ae4.tar.gz
?partition=foo
-rw-r--r--src/couch_mrview/include/couch_mrview.hrl2
-rw-r--r--src/couch_mrview/src/couch_mrview_http.erl4
-rw-r--r--src/couch_mrview/src/couch_mrview_util.erl32
3 files changed, 19 insertions, 19 deletions
diff --git a/src/couch_mrview/include/couch_mrview.hrl b/src/couch_mrview/include/couch_mrview.hrl
index 09faf51de..094b1d5f3 100644
--- a/src/couch_mrview/include/couch_mrview.hrl
+++ b/src/couch_mrview/include/couch_mrview.hrl
@@ -89,7 +89,7 @@
callback,
sorted = true,
partitioned,
- partition_key,
+ partition,
extra = []
}).
diff --git a/src/couch_mrview/src/couch_mrview_http.erl b/src/couch_mrview/src/couch_mrview_http.erl
index 5ff7285aa..fac1d42ce 100644
--- a/src/couch_mrview/src/couch_mrview_http.erl
+++ b/src/couch_mrview/src/couch_mrview_http.erl
@@ -582,8 +582,8 @@ parse_param(Key, Val, Args, IsDecoded) ->
Args#mrargs{callback=couch_util:to_binary(Val)};
"sorted" ->
Args#mrargs{sorted=parse_boolean(Val)};
- "partition_key" ->
- Args#mrargs{partition_key=couch_util:to_binary(Val)};
+ "partition" ->
+ Args#mrargs{partition=couch_util:to_binary(Val)};
_ ->
BKey = couch_util:to_binary(Key),
BVal = couch_util:to_binary(Val),
diff --git a/src/couch_mrview/src/couch_mrview_util.erl b/src/couch_mrview/src/couch_mrview_util.erl
index aa67c8805..a5e384012 100644
--- a/src/couch_mrview/src/couch_mrview_util.erl
+++ b/src/couch_mrview/src/couch_mrview_util.erl
@@ -560,15 +560,15 @@ validate_args(Args) ->
_ -> mrverror(<<"Invalid value for `sorted`.">>)
end,
- case {Args#mrargs.partitioned, Args#mrargs.partition_key} of
+ case {Args#mrargs.partitioned, Args#mrargs.partition} of
{true, undefined} ->
- mrverror(<<"`partition_key` parameter is mandatory for queries to this database.">>);
- {true, _PartitionKey} ->
+ mrverror(<<"`partition` parameter is mandatory for queries to this database.">>);
+ {true, _Partition} ->
ok;
{undefined, undefined} ->
ok;
- {undefined, _PartitionKey} ->
- mrverror(<<"`partition_key` parameter is not supported in this database.">>)
+ {undefined, _Partition} ->
+ mrverror(<<"`partition` parameter is not supported in this database.">>)
end,
Args.
@@ -592,23 +592,23 @@ update_args(#mrargs{} = Args) ->
HighestKey = {[{<<239, 191, 176>>, null}]}, % \ufff0
{StartKey, EndKey} = case Args of
- #mrargs{partition_key=undefined} ->
+ #mrargs{partition=undefined} ->
{Args#mrargs.start_key, Args#mrargs.end_key};
- #mrargs{partition_key=PKey0} when not is_binary(PKey0) ->
- mrverror(<<"`partition_key` must be a string.">>);
+ #mrargs{partition=P0} when not is_binary(P0) ->
+ mrverror(<<"`partition` must be a string.">>);
- #mrargs{partition_key=PKey0, start_key=undefined, end_key=undefined} ->
- {[PKey0, LowestKey], [PKey0, HighestKey]};
+ #mrargs{partition=P0, start_key=undefined, end_key=undefined} ->
+ {[P0, LowestKey], [P0, HighestKey]};
- #mrargs{partition_key=PKey0, start_key=SK0, end_key=undefined} ->
- {[PKey0, SK0], [PKey0, HighestKey]};
+ #mrargs{partition=P0, start_key=SK0, end_key=undefined} ->
+ {[P0, SK0], [P0, HighestKey]};
- #mrargs{partition_key=PKey0, start_key=undefined, end_key=EK0} ->
- {[PKey0, LowestKey], [PKey0, EK0]};
+ #mrargs{partition=P0, start_key=undefined, end_key=EK0} ->
+ {[P0, LowestKey], [P0, EK0]};
- #mrargs{partition_key=PKey0, start_key=SK0, end_key=EK0} ->
- {[PKey0, SK0], [PKey0, EK0]}
+ #mrargs{partition=P0, start_key=SK0, end_key=EK0} ->
+ {[P0, SK0], [P0, EK0]}
end,
Args#mrargs{