title: Cloud Functions - Preventing triggers on certain fields
body: <p>I have an app that people can request food , then I have orders, each order have an status for that order so I made a function that will send a user notification each time the status of this order changes, the status can be changed by the store which take the order and by the user when the order is done.</p>
  
  <p>But I want to limit the execution of this function to just 2 fields, the userId and the status fields, because now I have onUpdated, this trigger will always launch whenever an update is made to this document.</p>
  
  <p>I'm planning to update other fields than uid and status for this document and I dont want the trigger to relaunch again and send a notification to the user if not needed.</p>
  
  <p>Is there anyway to limit the trigger by just certain fields in the document?</p>
  
  <pre><code>exports.onOrderUpdated = functions.firestore
  .document('orders/{orderId}').onUpdate((change, context) =&gt; {
  
      var db = admin.firestore();
  
      try{
          const orderDataSnap = change.after.data();
          var userId = orderDataSnap.uid;
          var orderStatus = orderDataSnap.status;
      }catch(error){
          return handleErrorToUser(error);
      }
  </code></pre>
  
  <p>Here I only want to execute this function only when userId and status changes in that document</p>
  
  <p>Is there anyway to do this ?</p>
  
  <p>Thanks</p>