Forum Discussion
aditya_sharma
9 years agoNew Contributor III
Hi Akidave,
Thanks you so much for your solution. However, I would really appreciate if you could explain me more why we should not modify the document once it has been written to the output view.
Thanks again.
Aditya
akidave
9 years agoEmployee
If a snap writes a document to output view and then modifies the document, the downstream snap might pick up the updated document value, not the document originally written. For performance reasons, a deep copy is not done automatically when the document is written to the output view.
Creating a Map in the script works in this case since the Script is changing only the top level keys. If the Script was changing the contents of the nested map, then a deep copy would be required in the Script
- aditya_sharma9 years agoNew Contributor III
Thank you so much Akidave