Menu

gitpiper

Erlang ETS Cheat Sheet in March 2024

Last Updated: 7 March 2024

README.md

ETS

Usage

iex> table = :ets.new(:my_table, [])
     8211
iex> :ets.insert(table, {:fruit, "Apple"})
iex> :ets.lookup(table, :fruit)
     [{:fruit, "Apple"}]
iex> :ets.delete(table)
iex> :ets.delete_all_objects(table)

Flags

iex> table = :ets.new(:my_table, [:set, :protected])

{: .-setup}

| :set | no duplicate keys (or: :ordered_set, :bag, :duplicate_bag) |
| :protected | only this process can use it (or: :public, :private) |

Ordered sets

:ets.first(table)
:ets.last(table)
:ets.next(table, key)
:ets.prev(table, key)

References

{: .-one-column}


338+ more cheat sheets for you in March 2024

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️

© 2024 GitPiper. All rights reserved

Rackpiper Technology Inc

Company

About UsBlogContact

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️