anchor.diff:          [{_K, V}|_T] -> V
       end,
       close(Table),
  -    Result#{<<"_key">> => Id}.
  +    to_model(Result#{<<"_key">> => Id}).
   
   %% 更新数据，返回ok | notfound
  -update(Table, Id, Data1) when is_map(Data1) ->
  +update(Table, #{<<"_key">> := Id}=Data1) when is_map(Data1) ->
       init(Table),
       OldData = get(Table, Id),
  -    Time = pp_time:now_to_iso(),
  -    Data = maps:merge(OldData, Data1#{<<"_lastmodified_at">> => Time}),
  +    Time = ss_time:now_to_iso(),
  +    Data2 = from_model(Data1),
  +    Data = maps:merge(OldData, Data2#{<<"_lastmodified_at">> => Time}),
       dets:insert(Table, {Id, Data}),
       close(Table).
   %% 部分更新
  -patch(Table, Id, Data) when is_map(Data) ->
  +patch(Table, #{<<"_key">> := Id}= Data) when is_map(Data) ->
       {ok, Old} = get(Table, Id),
  -    New = maps:merge(Old, Data),
  -    update(Table, Id, New).
  +    New = maps:merge(Old, from_model(Data)),
  +    update(Table, to_model(New)).
   
   %% 删除
  -delete(Table, Id) ->
  +delete(Table, #{<<"_key">> := Id}) ->
       init(Table),
       dets:delete(Table, Id),
       close(Table).
  
positive.code: %% 创建数据，返回{ok, Id}
  %% Data应为maps类型
  %% 自动插入创建和最后修改时间时间戳, 使用ISO标准格式
  create(Table, Data) when is_map(Data) ->
      {_, S, M} = now(),
      Id = pp:to_binary(io_lib:format("~B-~6..0B", [S, M])),
      ok = create(Table, Id, Data),
      {ok, Id}.
  create(Table, Id, Data1) when is_map(Data1) ->
      init(Table),
      Time = pp_time:now_to_iso(),
      Data = Data1#{<<"_created_at">> => Time, <<"_lastmodified_at">> => Time},
      dets:insert(Table, {Id, Data}),
      close(Table).
  
  %% 查看
  %% 直接返回所查到的maps类型，方便函数级联操作
  
negative.code: %%% Created : 24 Dec 2014 by homeway <homeway.xue@gmail.com>
  %%%-------------------------------------------------------------------
  -module(ss_nosqlite).
  -export([init/1, from_model/1, to_model/1, create/2, update/2, patch/2, get/2, delete/2, search/3]).
  -export([all/1]).
  
  %% 表初始化
  init(Table) ->
      Filename = io_lib:format("data/~s.dets", [ss:to_binary(Table)]),
      filelib:ensure_dir(Filename),
      dets:open_file(Table, [{type, set}, {file, Filename}, {repair, true}]).
  close(Table) ->
  