anchor.diff:      <<"The request body must be an array of action objects.">>;
   format_error(Else) ->
       mango_util:fmt("Unknown error: ~p", [Else]).
  -
  -
  -get_body_actions(Db, Req) ->
  -    case chttpd:json_body(Req) of
  -        Body0 when is_list(Body0) ->
  -            {ok, lists:map(fun(Item) ->
  -                mango_action:new(Db, Item)
  -            end, Body0)};
  -        _ ->
  -            ?MANGO_ERROR(body_not_an_array)
  -    end.
  -
  -
  -handle_actions(Writer, _Db, []) ->
  -    {ok, Writer};
  -handle_actions(Writer, Db, [Action | Rest]) ->
  -    {ok, NewWriter} = mango_action:run(Writer, Db, Action),
  -    handle_actions(NewWriter, Db, Rest).
   
   
   set_user_ctx(#httpd{user_ctx=Ctx}, Db) ->
  
positive.code: 
  
  -export([
      handle_query_req/2,
      format_error/1
  ]).
  
  
negative.code: -include("mango.hrl").
  
  
  handle_index_req(#httpd{method='GET'}=Req, _Db) ->
      % List indexes
  	chttpd:send_json(Req, {[{ok, true}]});
  handle_index_req(#httpd{method='POST'}=Req, _Db) ->
      % Create index
  	chttpd:send_json(Req, {[{ok, true}]});
  handle_index_req(#httpd{method='DELETE'}=Req, _Db) ->
      % Delete index
  	chttpd:send_json(Req, {[{ok, true}]});
  handle_index_req(Req, _Db) ->
      chttpd:send_method_not_allowed(Req, "GET,POST,DELETE").
  
  
  handle_find_req(#httpd{method='POST'}=Req, _Db) ->
      % Execute query
  	chttpd:send_json(Req, {[{ok, true}]});
  handle_find_req(Req, _Db) ->
      chttpd:send_method_not_allowed(Req, "POST").
  
  
  