title: Read data from Cloud Functions for Firebase?
body: <p>I am using this code:</p>
  
  <pre><code>exports.lotteryTickets = functions.database.ref('/lottery/ticketsneedstobeprocessed/{randomID}').onWrite(event =&gt; {
      let ticketsBoughtByUser = event.data.val();
  
  })
  </code></pre>
  
  <p>But ticketsBoughtByUser is not correct. How can I retrieve the the number shown in the picture below, so next to the string (oeb...)? Thank you.</p>
  
  <p><a href="https://i.stack.imgur.com/mHM4U.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mHM4U.png" alt="enter image description here"></a></p>
  
  <p>I get this log:<a href="https://i.stack.imgur.com/KoVCe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KoVCe.png" alt="enter image description here"></a></p>