@davisp trolled me by changing the default value of keys
Project: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/commit/40dd2379 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/tree/40dd2379 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/diff/40dd2379 Branch: refs/heads/import Commit: 40dd2379001f682a997b6985b5cf1f382554ced1 Parents: 63bfcfe Author: Robert Newson <rnew...@apache.org> Authored: Mon Dec 23 11:35:55 2013 +0000 Committer: Paul J. Davis <paul.joseph.da...@gmail.com> Committed: Fri Jan 17 13:49:32 2014 -0800 ---------------------------------------------------------------------- src/fabric_rpc.erl | 6 +++--- src/fabric_view.erl | 2 +- src/fabric_view_all_docs.erl | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-fabric/blob/40dd2379/src/fabric_rpc.erl ---------------------------------------------------------------------- diff --git a/src/fabric_rpc.erl b/src/fabric_rpc.erl index 2685cd7..9ca4f62 100644 --- a/src/fabric_rpc.erl +++ b/src/fabric_rpc.erl @@ -39,7 +39,7 @@ %% rpc endpoints %% call to with_db will supply your M:F with a #db{} and then remaining args -all_docs(DbName, #mrargs{keys=nil} = QueryArgs) -> +all_docs(DbName, #mrargs{keys=undefined} = QueryArgs) -> {ok, Db} = get_or_create_db(DbName, []), #mrargs{ start_key = StartKey, @@ -122,7 +122,7 @@ map_view(DbName, DDoc, ViewName, QueryArgs) -> reduce_fun = fun couch_view:reduce_to_count/1 }, case Keys of - nil -> + undefined -> Options = couch_httpd_view:make_key_options(QueryArgs), {ok, _, Acc} = couch_view:fold(View, fun view_fold/3, Acc0, Options); _ -> @@ -163,7 +163,7 @@ reduce_view(DbName, Group0, ViewName, QueryArgs) -> ReduceView = {reduce, NthRed, Lang, View}, Acc0 = #view_acc{group_level = GroupLevel, limit = Limit+Skip}, case Keys of - nil -> + undefined -> Options0 = couch_httpd_view:make_key_options(QueryArgs), Options = [{key_group_fun, GroupFun} | Options0], couch_view:fold_reduce(ReduceView, fun reduce_fold/3, Acc0, Options); http://git-wip-us.apache.org/repos/asf/couchdb-fabric/blob/40dd2379/src/fabric_view.erl ---------------------------------------------------------------------- diff --git a/src/fabric_view.erl b/src/fabric_view.erl index 9cb4b03..942231f 100644 --- a/src/fabric_view.erl +++ b/src/fabric_view.erl @@ -178,7 +178,7 @@ possibly_embed_doc(#collector{db_name=DbName, query_args=Args}, end. -keydict(nil) -> +keydict(undefined) -> undefined; keydict(Keys) -> {Dict,_} = lists:foldl(fun(K, {D,I}) -> {dict:store(K,I,D), I+1} end, http://git-wip-us.apache.org/repos/asf/couchdb-fabric/blob/40dd2379/src/fabric_view_all_docs.erl ---------------------------------------------------------------------- diff --git a/src/fabric_view_all_docs.erl b/src/fabric_view_all_docs.erl index 1745fc4..1f9f460 100644 --- a/src/fabric_view_all_docs.erl +++ b/src/fabric_view_all_docs.erl @@ -19,7 +19,7 @@ -include_lib("mem3/include/mem3.hrl"). -include_lib("couch/include/couch_db.hrl"). -go(DbName, #view_query_args{keys=nil} = QueryArgs, Callback, Acc0) -> +go(DbName, #view_query_args{keys=undefined} = QueryArgs, Callback, Acc0) -> Workers = fabric_util:submit_jobs(mem3:shards(DbName),all_docs,[QueryArgs]), #view_query_args{limit = Limit, skip = Skip} = QueryArgs, State = #collector{