anchor.diff:      {reply, do_create_permission(State, Rec), State};
   handle_call({delete_permission, Rec}, _From, State) ->
       {reply, do_delete_permission(State, Rec), State};
  -handle_call({get_permission, Query}, _From, State) ->
  -    {reply, do_get_permission(State, Query), State};
   handle_call({get_permissions, Query}, _From, State) ->
     {reply, do_get_permissions(State, Query), State};
   
  
positive.code: update_user(Rec) ->
      gen_server:call(?SERVER, {update_user, Rec}).
  
  -spec(get_user_by_id(Id :: non_neg_integer()) -> {ok, #user{}} | {error, string() | [string()]}).
  get_user_by_id(Id) ->
      gen_server:call(?SERVER, {get_user, #{<<"_id">> => id_to_objectid(Id)}}).
  
  -spec(get_user_by_email(Email :: string()) -> {ok, #user{}} | {error, string() | [string()]}).
  get_user_by_email(Email) ->
      gen_server:call(?SERVER, {get_user, #{<<"email">> => Email}}).
  
  -spec(get_users() -> {ok, [#user{}]} | {error, string() | [string()]}).
  get_users() ->
      gen_server:call(?SERVER, {get_users}).
  
negative.code:                end,
      mongoc:transaction_query(Topology, Callback).
  
  do_create_device(#state{topology = Topology}, Rec) ->
      Map = to_map(device, Rec#device{id = gen_id(), status = <<"">>, lastUpdate = 0, positionId = 0}),
      Callback = fun(Worker) ->
  