Edit: for your example, assoc-in better since you are ignoring the previous value. Keeping this answer for cases when you really need the previous value:
update-in there is the possibility of updating nested structures:
(alter some-map update-in [1 :firstname] (constantly "nick"))
The last argument is the function for the value to be replaced (for example, assoc , it does not replace, but returns a new structure.) In this case, the old value is ignored, therefore, the function is constantly , which always returns "nick".
source share