anchor.diff:              end
       end.
   
  +set_namespace(<<"_all_docs">>, Args) ->
  +    set_namespace(undefined, Args);
  +set_namespace(<<"_local_docs">>, Args) ->
  +    set_namespace(<<"_local">>, Args);
  +set_namespace(<<"_design_docs">>, Args) ->
  +    set_namespace(<<"_design">>, Args);
   set_namespace(NS, #mrargs{extra = Extra} = Args) ->
       Args#mrargs{extra = [{namespace, NS} | Extra]}.
   
  
positive.code: db_req(#httpd{path_parts=[_, DocId | FileNameParts]}=Req, Db) ->
      db_attachment_req(Req, Db, DocId, FileNameParts).
  
  all_docs_view(Req, Db, Keys) ->
      all_docs_view(Req, Db, Keys, undefined).
  all_docs_view(Req, Db, Keys, NS) ->
      Args0 = couch_mrview_http:parse_params(Req, Keys),
      Args1 = set_namespace(NS, Args0),
  
negative.code: db_req(#httpd{path_parts=[_,<<"_purge">>]}=Req, _Db) ->
      send_method_not_allowed(Req, "POST");
  
  db_req(#httpd{method='GET',path_parts=[_,NS]}=Req, Db) when ?IS_ALL_DOCS(NS) ->
      case chttpd:qs_json_value(Req, "keys", nil) of
      Keys when is_list(Keys) ->
          all_docs_view(Req, Db, Keys, NS);
      nil ->
          all_docs_view(Req, Db, undefined, NS);
      _ ->
          throw({bad_request, "`keys` parameter must be an array."})
      end;
  
  db_req(#httpd{method='POST',path_parts=[_,NS]}=Req, Db) when ?IS_ALL_DOCS(NS) ->
      {Fields} = chttpd:json_body_obj(Req),
      case couch_util:get_value(<<"keys">>, Fields, nil) of
      Keys when is_list(Keys) ->
          all_docs_view(Req, Db, Keys, NS);
      nil ->
          all_docs_view(Req, Db, undefined, NS);
      _ ->
          throw({bad_request, "`keys` body member must be an array."})
      end;
  
  db_req(#httpd{path_parts=[_,NS]}=Req, _Db) when ?IS_ALL_DOCS(NS) ->
      send_method_not_allowed(Req, "GET,HEAD,POST");
  
  db_req(#httpd{method='POST',path_parts=[_,<<"_missing_revs">>]}=Req, Db) ->
  