anchor.diff:  -export([code_change/3]).
   -export([handle_cast/2]).
   
  +-record(state, {dbid, hackney_ref, hackney_acc, first_seq, buffer=[]}).
  +
  +
   start(Name, Store) ->
     gen_server:call(?MODULE, {start, Name, Store}).
   
  
positive.code:   req(Method, Url, Body);
  
  req(Method, Url, Body) ->
    {ok, Code, _Headers, Ref} = hackney:request(Method, Url, [], Body, []),
    {ok, Answer} = hackney:body(Ref),
    {Code, Answer}.
  
negative.code: handle_info(_Info, State) -> {noreply, State}.
  
  %% default gen_server callbacks
  terminate(_Reason, _State) ->
    ok.
    
  code_change(_OldVsn, State, _Extra) -> {ok, State}.
  
  %% ----------
  
  
  post_put(Method, Url, Doc, State) ->
    {Code, Reply} = req(Method, Url, Doc),
    post_put_resp(Code, Reply, State).
  
  
  post_put_resp(404, _, State) ->
    {reply, {error, not_found}, State};
  
  post_put_resp(200, R, State) ->
    Answer = jsx:decode(R, [return_maps, {labels, attempt_atom}]),
    DocId = maps:get(id, Answer),
    RevId = maps:get(rev, Answer),
    true = maps:get(ok, Answer),
    Reply = {ok, DocId, RevId},
    {reply, Reply, State}.
  
  
  get_resp(404, _, State) ->
    {reply, {error, not_found}, State};
  
  get_resp(200, Reply, State) ->
    Doc = jsx:decode(Reply, [return_maps]),
    {reply, {ok, Doc}, State}.
  
  
  fold_result(Fun, Acc, Results) ->
    Folder = fun(DocInfo, A) ->
  