Skip to content Skip to sidebar Skip to footer

Firestore Cloud Functions | Trigger Events Based On Time Field Is Equal To

The Question Can you fire a firebase cloud function when a fields meet certain values for a specific amount of duration? Background of the project I have built a temperature sensor

Solution 1:

Currently, you can't limit the specific conditions under which an event fires. Your Firestore trigger will receive one event for each change that meets the general criteria of the trigger. So, for onUpdate triggers, any change to a document that matches the general criteria (the document path) will fire that trigger. You can't be selective about which document properties may invoke your function. You have to check inside the function if it's an event you'd like to respond to, and return early if you don't want to do anything with it.


Post a Comment for "Firestore Cloud Functions | Trigger Events Based On Time Field Is Equal To"