Navigation: Developing Apps > BINETIX® AGE™ API > The Node > Toolkits > age_lists
update_key/3
Description
update_key/3 is an Erlang function exported by "age_lists" module.
Updates or appends particular pair of Key with Value into a list of terms. Always returns a normalized list of unique (non-repeated) terms.
References
None
Parameters
Name
Type
Key
atom()
Key name.
Value
any()
Value to be updates when key is found.
Input
list()
Input list of terms.
Result
Value or Type
Returns a modified list of terms.
Code Sample
> age_lists:update_key(b, 200, [{a, 1}, {b, 2}, {c, 3}]). [{a,1}, {b,200}, {c,3}] > age_lists:update_key(z, 200, [{a, 1}, {b, 2}, {c, 3}, {b, 4}]). [{a,1}, {b,2}, {c,3}, {z,200}]