title: how to run firebase query inside a function in node js
body: <p>I have a function which should query firebase db and return a result.</p>
  
  <pre><code> function verifyToken(token)
   {
      var androidId = 'xxxxx';
      admin.database(dbDEV).ref('profiles').orderByChild('androidId').equalTo(androidId).on('value',(snapshot)=&gt;{
      console.log(snapshot.val());
      return snapshot.val();
     });
   }
  </code></pre>
  
  <p>I am using firebase functions for this . so the result is getting logged in firebase logs but i am not getting and return value while executing the function.</p>