I have a collection called 'equipment' and I've set up a cloud function whenever an update is triggered on any document within that collection.
However, I want to update a field on said document within that onUpdate trigger.
By the looks of it. When I either of the below. It is updating the property of the document which is in turn triggering the cloud function again, causing a loop to happen.
event.data.ref.set({property: updatedValue}, {merge: true})
or
event.data.ref.update({property: updatedValue})
Is there any other way of updating a variable inside an onUpdate trigger without it causing this loop?
Thanks