While updating data in document, we will come across various scenarios, let us analyze them step by step.
The updated output is:
The value of field name is updated from xyz to ABC.
and if we want to update that array by adding values, we can do it by referring the below code snippet:
and Amit is added to the array against field friends.
Here is the code snippet:
and the corresponding output is: