[erlang-questions] Store maps in ets/dets?

Daniel Goertzen daniel.goertzen@REDACTED
Mon Apr 14 16:09:38 CEST 2014


Direct map support in ets, dets, and mnesia would indeed be nice.  I am
currently using a number of mnesia tables to pack maps into tuples with the
key copied into the first tuple spot:


#{key => 123, value1 => abc, value2 => 3.14, ...}

... becomes...

{123, #{key => 123, value1 => abc, value2 => 3.14, ...}}

Dan.



On Thu, Apr 10, 2014 at 11:31 PM, Max Lapshin <max.lapshin@REDACTED> wrote:

> I'm asking exactly about
>
>  ets:insert(web_sessions, #{session_id => <<"1234">>,bytes => 0}).
>
> ets:update_counter(web_sessions, <<"1234">>, {bytes, 150})
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140414/01342e60/attachment.htm>


More information about the erlang-questions mailing list