title: OnUpdate Firebase Database Trigger
body: <p>I am trying to write a basic firebase trigger, that when a condition in my realtime database is changed will fire the trigger leading to a FCM notification, but I am stuck on the first step and cannot make the Onupdate trigger work correctly.
  My database has no users at the moment and only has this condition inside of it, I tried searching frantically, but have been unable to find something to make this work. </p>
  
  <pre><code>        // This code sets up the Firebase SDK to create functions and triggers.
  const functions = require('firebase-functions');
  // This gives the Firebase Admin SDK Access to the database
  const admin = require('firebase-admin');
  admin.initializeApp(functions.config().firebase);
  
  
  
  exports.sendNotification = functions.database
          .ref("/condition/{}").onCreate(event =&gt; {
      if (event.data.exists() &amp;&amp; event.data.previous.exists())
          {
              return; 
          }
  });
  </code></pre>