Consider that you have a collection called user
with documents such as:
data class User(
val name: String = ""
)
And also have a google cloud function which is triggered onUpdate
.
What happens if I do this for an non-existing document:
fs.collection("users").document("new-user").set(hashMapOf("name" to "Jane"), SetOptions.merge())
and later do this again (now document exists):
fs.collection("users").document("new-user").set(hashMapOf("name" to "Jane"), SetOptions.merge())
According to the documentation:
onUpdate: Triggered when a document already exists and has any value changed.
I want to know if my function is triggered in my example (no field has been updated). No property of the collection has been updated, but I am guessing that some metadata (e.g. update timestamp) must have been changed.