anchor.diff:  -include("mango.hrl").
   -include("mango_idx.hrl").
   
  +-record(vacc, {
  +    resp,
  +    prepend,
  +    kvs
  +}).
   
   handle_req(#httpd{} = Req, Db0) ->
       try
  
positive.code:     {ok, Opts0} = mango_opts:validate_find(chttpd:json_body_obj(Req)),
      {value, {selector, Sel}, Opts} = lists:keytake(selector, 1, Opts0),
      {ok, Resp0} = start_find_resp(Req),
      {ok, {Resp1, _, KVs}} = run_find(Resp0, Db, Sel, Opts),
      end_find_resp(Resp1, KVs);
  
  handle_find_req(Req, _Db) ->
      chttpd:send_method_not_allowed(Req, "POST").
  
negative.code:     chttpd:start_delayed_json_response(Req, 200, [], "{\"docs\":[").
  
  
  end_find_resp(Acc) ->
      #vacc{resp=Resp0, kvs=KVs} = Acc,
      FinalAcc = lists:foldl(fun({K, V}, Acc) ->
          JK = ?JSON_ENCODE(K),
          JV = ?JSON_ENCODE(V),
  