anchor.diff:      Diff = (timer:now_diff(now(), Timestamp) / 1000 / 1000),
       Diff > TTL.
   
  +update_indexes(_Bucket, _Key, [], _IndexRef) ->
  +    ok;
  +update_indexes(Bucket, Key, [{remove, Field, Value}|Rest], IndexRef) ->
  +    true = ets:delete(IndexRef, {Bucket, Field, Value, Key}),
  +    update_indexes(Bucket, Key, Rest, IndexRef);
  +update_indexes(Bucket, Key, [{add, Field, Value}|Rest], IndexRef) ->
  +    true = ets:insert(IndexRef, {{Bucket, Field, Value, Key}, <<>>}),
  +    update_indexes(Bucket, Key, Rest, IndexRef).
  +
   %% @private
   time_entry(Bucket, Key, Now, TimeRef) ->
       ets:insert(TimeRef, {Now, {Bucket, Key}}).
  
positive.code: %% @private
  %% @doc Dump some entries if the max memory size has
  %% been breached.
  trim_data_table(MaxMemory, UsedMemory, _, _, Freed) when
        (UsedMemory - Freed) =< MaxMemory ->
      Freed;
  trim_data_table(MaxMemory, UsedMemory, DataRef, TimeRef, Freed) ->
      %% Delete the oldest object
      OldestSize = delete_oldest(DataRef, TimeRef),
      trim_data_table(MaxMemory,
                      UsedMemory,
                      DataRef,
                      TimeRef,
                      Freed + OldestSize).
  
  %% @private
  delete_oldest(DataRef, TimeRef) ->
      OldestTime = ets:first(TimeRef),
      case OldestTime of
          '$end_of_table' ->
  
negative.code:         _ ->
              Val1 = {{ts, Now}, Val}
      end,
      case do_put(Bucket, PrimaryKey, Val1, IndexSpecs, DataRef, IndexRef) of
          {ok, Size} ->
              %% If the memory is capped update timestamp table
              %% and check if the memory usage is over the cap.
  