You're right, because of the different data models, Cloud Firestore allows you to run cloud-based functions at document-level events rather than field-level events.
One method is to store the email in a separate document (for example, in a subset called email), so updating an email is just a change that will work. This requires you to read an additional document every time you need an email address.
Another similar method is to still have it in the same document, but also write it to a subset as the second entry to run the function. Use email as the document I have, and enter a timestamp field in the document to make it easier to clear the old document (select the oldest email address to delete, maybe even in function)
source share