title: How to get database value not related to the event in Cloud Functions for Firebase?
body: <p>I have a firebase database and I am currently trying to use cloud functions to perform an operation when a value in my database changes. So far, it successfully triggers code to run when the value in my database changes. However, when the database value changes, I now need to check another value to determine it's status, and then perform an action after that. The problem is that I have ~0 experience with JS and I have no way of debugging my code other than deploying, changing the value in my database, and looking at the console log.</p>
  
  <p>Is there any way to look up another value in the database and read it? How about look up a value and then set a value for it? Here is the code:</p>
  
  <p>exports.determineCompletion = </p>
  
  <pre><code>functions.database.ref('/Jobs/{pushId}/client_job_complete')
      .onWrite(event =&gt; {
  
          const status = event.data.val();
          const other = functions.database.ref('/Jobs/' + event.params.pushId + '/other_job_complete');
          console.log('Status', status, other);
  
          if(status == true &amp;&amp; **other.getValueSomehow** == true) {
              return **setAnotherValue**;
          }
  
  
      });
  </code></pre>
  
  <p>This code partially works, it successfully gets the value associated with client_job_complete and stores it in status. But how do I get the other value?</p>
  
  <p>Additionally, if anyone has any JS or firebase documentation that they think would help me, please share! I have read a bunch on firebase here : <a href="https://firebase.google.com/docs/functions/database-events" rel="noreferrer">https://firebase.google.com/docs/functions/database-events</a> but it only talks about events and is very brief</p>
  
  <p>Thank you for your help!</p>