XEts.KV.put_new
You're seeing just the function
put_new
, go back to XEts.KV module for more information.
Link to this function
put_new(tab, item_or_items)
Specs
Put one or more new items into the table.
iex> XEts.KV.new(:foo, []) |>
...> XEts.KV.put({:k, :v}) |>
...> XEts.KV.put_new(:k, :v2) |>
...> XEts.KV.to_list()
[{:k, :v}]
iex> XEts.KV.new(:foo, []) |>
...> XEts.KV.put(k: :v, k2: :v2) |>
...> XEts.KV.put_new([k: :v3, k2: :vv]) |>
...>XEts.KV.to_list()
[{:k, :v}, {:k2, :v2}]
Link to this function
put_new(tab, key, value)
Put an item into the table if it doesn't exist.
iex> XEts.KV.new(:foo, []) |> XEts.KV.put_new(:k, :v) |> XEts.KV.to_list()
[{:k, :v}]