olddev
olddev

Reputation: 15

How to access to value in ets?

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?

Upvotes: 0

Views: 194

Answers (1)

Srijan Choudhary
Srijan Choudhary

Reputation: 480

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)

Upvotes: 0

Related Questions