无法删除并从ETS表中选择
我很难从ET中检索和删除记录。
在插入它们之后:
:ets.insert(
:table_name,
{id, location, [name, x, z]}
)
我无法像这样删除它们:
:ets.delete(:table_name, id)
我也尝试过,这没有返回任何内容。
:ets.match(:table_name, {id, location, '_'})
I am having trouble retrieving and deleting records from ETS.
After inserting them like:
:ets.insert(
:table_name,
{id, location, [name, x, z]}
)
I am unable to delete them like so:
:ets.delete(:table_name, id)
I have also tried and this doesn't return anything.
:ets.match(:table_name, {id, location, '_'})
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果要在ET(和DETS)周围使用长生不老药包装器,则可以使用 pockets :
If you want to use an Elixir wrapper around ETS (and DETS), you can use pockets:
ETS 的内容:
您始终
可以使用
:
:ETS.MATCH/2
应该使用 Atoms ( elixir 与 erlang 在如何表示它们中)和指定要返回的内容。You always can review the content of
:ets
with:ets.foldl/3
:ets.delete/2
works out of the box:For
:ets.match/2
one should use atoms (elixir differs from erlang in how to denote them) and specify what to return back.