Improve fabric:all_docs spec
- fabric:all_docs supports options passed as proplist
- fabric:all_docs return value is controled by a callback therefore it
should be `{ok, any()}`
diff --git a/src/fabric.erl b/src/fabric.erl
index aa96513..fe663be 100644
--- a/src/fabric.erl
+++ b/src/fabric.erl
@@ -277,8 +277,11 @@
%% also be passed to further constrain the query. See <a href=
%% "http://wiki.apache.org/couchdb/HTTP_Document_API#All_Documents">
%% all_docs</a> for details
--spec all_docs(dbname(), [{atom(), any()}], callback(), [] | tuple(), #mrargs{}) ->
- {ok, [any()]}.
+-spec all_docs(
+ dbname(), [{atom(), any()}], callback(), [] | tuple(),
+ #mrargs{} | [option()]) ->
+ {ok, any()}.
+
all_docs(DbName, Options, Callback, Acc0, #mrargs{} = QueryArgs) when
is_function(Callback, 2) ->
fabric_view_all_docs:go(dbname(DbName), opts(Options), QueryArgs, Callback, Acc0);