@edith_t, you still did not mark turivishal’s answer as the solution in your other thread.
Indicating that a thread is resolve and which post is the solution is the best way to keep this useful by providing confidence to others facing the same issue that you did.
To modify all elements of an array you need to use $map.