Cloud Function stuck in an infinite loop
问题 exports.addNewValue = functions.database.ref('/path') .onWrite(event => { event.data.adminRef.update({"timeSnapshot":Date.now()})}) It appears that Date.now() causes an infinite loop in the function because the following does not: exports.addNewValue = functions.database.ref('/path') .onWrite(event => { event.data.adminRef.update({"timeSnapshot":"newString"})}) How do I fix this? 回答1: If you write back to the same location in the database that was previously changed, you can expect this