title: 'Function returned undefined, expected Promise or value' with a function that just prints log
body: <p>There have been like hundred similar questions and most with the answer suggesting to <code>return</code> something. I did that.</p>
  
  <p>I learnt to implement cloud functions and wrote a function that does something on <code>write</code> event. That didn't work so I reduced the function recursively to come down to a single line of code that doesn't work either. </p>
  
  <p>My code is as follows. </p>
  
  <pre><code>const functions = require('firebase-functions');
  
  exports.demofunc = 
    functions.database
      .ref('/exportable/[some_long_ref]/newContacts')
      .onWrite(event =&gt; {
        console.log('Ok something changed')
        return true
      })
  </code></pre>
  
  <p>I expected this to work atleast but it didn't </p>
  
  <p>I'm getting logs as follows </p>
  
  <pre><code>Function execution took 413 ms, finished with status: 'ok'
  Function returned undefined, expected Promise or value
  Function execution started
  
  //[As you'd expect these logs are in reverse order.]
  </code></pre>
  
  <p>I also tried <code>return 0</code> but no success. </p>
  
  <p>As you might have realized by now, this is my first attempt with Cloud functions and JS.</p>
  
  <p>Any Help is appreciated. </p>