anchor.diff:  -export([content_types_accepted/2]).
   -export([read_json/2]).
   -export([write_json/2]).
  +-export([delete_resource/2]).
   
   -record(state, {path, segments, hash}).
   
  
positive.code:     {false, Req0, State#state{path = Path, segments = Segments}}.
  
  allowed_methods(Req, State) ->
      {[<<"GET">>, <<"PUT">>], Req, State}.
  
  resource_exists(Req, #state{path = Path} = State) ->
      Q = <<"select hash from objects where hash=md5($1)">>,
  
negative.code:     Q = <<"insert into objects(hash,version,path,value) values (md5($1),0,hstore($2::text[]),hstore($3::text[]))">>,
      {ok, _} = cloudstore_pg:equery(cloudstore_pool, Q, [Path, segments_to_hprops(Segments), props_to_hprops(Props)]),
      {true, Req0, State};
  
  write_json(Req, #state{hash = Hash} = State) ->
      {ok, Json, Req0} = cowboy_req:body(Req),
      {Props} = jiffy:decode(Json),
  