anchor.diff:      ok.
   
   %%% Internal functions
  +
  +build_where(Pairs) ->
  +    build_where(Pairs, {<<"">>, []}).
  +build_where([], {WhereStr, WhereList}) ->
  +    {WhereStr, lists:reverse(WhereList)};
  +build_where([{K, V} | T], {WhereStr, WhereList}) ->
  +    KNum = list_to_binary(integer_to_list(length(WhereList)+1)),
  +    VNum = list_to_binary(integer_to_list(length(WhereList)+2)),
  +    Str = case KNum of
  +              <<"1">> ->
  +                  <<" WHERE data->$", KNum/binary, "=$", VNum/binary>>;
  +              _KNum ->
  +                  <<" AND data->$", KNum/binary, "=$", VNum/binary>>
  +          end,
  +    NewWhereStr = <<WhereStr/binary, Str/binary>>,
  +    NewWhereList = [jsx:encode(V), K | WhereList],
  +    build_where(T, {NewWhereStr, NewWhereList}).
   
   to_insert_vals(Doc) ->
       [{K1, V1} | T] = jsx:decode(Doc),
  
positive.code: 
  %% Create new document with Name, assumes Name does not currently exist
  -spec insert(Table::binary(), Doc::jsx:json_text()) -> ok | {error, Error::binary()}.
  insert(Table, Doc) ->
      Values = to_insert_vals(Doc),
      dikdik_db:simple_query(<<"INSERT INTO ", Table/binary," (id, data) VALUES (uuid_generate_v4(), '", Values/binary,"')">>).
  
  -spec insert(Table::binary(), Key::binary(), Doc::jsx:json_text()) -> ok | {error, Error::binary()}.
  insert(Table, Key, Doc) ->
      Values = to_insert_vals(Doc),
      dikdik_db:simple_query(<<"INSERT INTO ", Table/binary," (id, data) VALUES ('", Key/binary, "','", Values/binary,"')">>).
  
  
negative.code: 
  %% API
  -export([all/0
          ,match/2
          ,new/1
          ,lookup/2
          ,insert/2, insert/3
  