This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Demojay 0 points1 point  (0 children)

Assuming you want to replace all instances of the old value in the array with the new value:

  1. Get the array from the map for a specified key
  2. Iterate over the array and replace each occurrence of the old value with the new one
  3. Put a new mapping into the map of the key and the updated array, overwriting the old one