title: When using the onUpdate function in Firebase, how do I retrieve the a child of the returned snapshot?
body: <p>I have the bellow code which used to run using a .onCreate, I changed it to a .onUpdate and now the .child() lines have errors indicating I cannot perform the action. How do I proceed? I need to access these values.</p>
  <pre><code>   export const sendNewMessageNotification = functions.database
    .ref('/ChatTimelines/{uid}/{chatID}/')
    .onUpdate((snapshot, context) =&gt; {
      //.onCreate
      const uid = context.params.uid
      const otherUID = snapshot.child(&quot;otherUID&quot;).val()//error
      const message = snapshot.child(&quot;lastMessage&quot;).val()//error
      snapshot
    
      //addNewLikeNotif(uid, newLikerUID, mediaNumber, timeStamp, postID)
      return sendNewMessageNotificationFunc(uid, otherUID, message) 
    })
  </code></pre>
  <p>Update: Update2 this did not work</p>
  <p>(change, context)</p>
  <pre><code> let snapshot = change.after.val()
  const otherUID = snapshot.child(&quot;otherUID&quot;).val()
  const message = snapshot.child(&quot;lastMessage&quot;).val()
  </code></pre>