anchor.diff:      _         -> updated
     end,
     Store = sumo_config:get_store(DocName),
  +  sumo_event:dispatch(DocName, list_to_atom("pre_" ++ atom_to_list(EventName)), [State]),
     case sumo_store:persist(Store, sumo_internal:new_doc(DocName, DocMap)) of
       {ok, NewDoc} ->
         Ret = sumo_internal:wakeup(NewDoc),
  
positive.code: -spec delete(schema_name(), user_doc()) -> boolean().
  delete(DocName, Id) ->
    IdField = sumo_internal:id_field_name(DocName),
    case delete_by(DocName, [{IdField, Id}]) of
      1 -> sumo_event:dispatch(DocName, deleted, [Id]), true;
      0 -> false
  
negative.code: -spec delete_all(schema_name()) -> non_neg_integer().
  delete_all(DocName) ->
    Store = sumo_config:get_store(DocName),
    sumo_event:dispatch(DocName, pre_delete_all),
    case sumo_store:delete_all(Store, DocName) of
      {ok, NumRows} ->
        case NumRows > 0 of
  