anchor.diff:                  {<<"username">>, UserName}
               ]}
           },
  -        {ok, _Rev} = couch_db:update_doc(Db, UserDoc, []),
  +        {ok, _Rev} = fabric:update_doc(Db, UserDoc, []),
           ?LOG_DEBUG("User ~s updated.", [UserName]),
           send_response(Req)
       end.
  
positive.code:     _Else ->
          ?LOG_INFO("no record of user ~s", [UserName]),
          nil
      end,
      couch_db:close(Db),
      UserProps.
  
  ensure_users_db_exists(DbName) ->
      Options = [{user_ctx, #user_ctx{roles=[<<"_admin">>]}}],
      case couch_db:open(DbName, Options) of
      {ok, Db} ->
          {ok, Db};
      {error, _} -> 
          couch_db:create(DbName, Options)
      end.
  
  % internal functions
  
negative.code:             revs = {Pos, [Rev]},
              deleted = true
          },
          {ok, _Rev} = fabric:update_doc(Db, UserDoc, []),
          send_response(Req)
      end.
  
  