How to access to value in ets?

174 views Asked by At
value = :ets.lookup(:table, key)

So, in example above, when I use ets.lookup i receive a list with map that's contains a key and values. But i want to get values only. What should I do?

1

There are 1 answers

0
Srijan Choudhary On BEST ANSWER

You can use ets:lookup_element/3. Doc: https://www.erlang.org/doc/man/ets.html#lookup_element-3

user = :ets.lookup_element(:users, hash, 2)