How to set a field for every item in an array

If you need to use a current value from the same document you will need to use the update with aggregation.

The $[]is however not available. You will need to use $map to accomplish the modification of the array.

1 Like