I have a cloud function that listens to updates to a path in firestore
export const onUserWrite = functions.firestore.document('/path/path').onWrite(async (change) => {
if (!change.after.exists) {
return;
}
await change.after.ref.update({somedata:'data'});
return true;
});
I think this will cause an infinite loop because, this code await change.after.ref.update({somedata:'data'}); should trigger the function again, thus causing an infinite loop.
if so why wouldn't the documentation mention this?