title: TypeError: Cannot read property 'from' of undefined error
body: <p>i am trying to make a firebase push notification application
  and while uploading the script i am having this error.i dont understand the cannot read property error</p>
  
  <pre><code>TypeError: Cannot read property 'from' of undefined
     at admin.firestore.collection.doc.collection.doc.get.then.queryResult 
      (/user_code/index.js:16:48)
      at process._tickDomainCallback (internal/process/next_tick.js:135:7)
  </code></pre>
  
  <p>and here is my node.js script</p>
  
  <pre><code>'use-strict'
  
  const functions = require('firebase-functions');
  const admin = require('firebase-admin');
  admin.initializeApp(functions.config().firebase);
  
   exports.sendNotification = 
    functions.firestore.document("Users/{user_id}/Notifications/{notification_id}")
      .onWrite((change,context)=&gt; {
  
  const user_id = context.params.user_id;
  const notification_id = context.params.notification_id;
  
  console.log("User ID : " + user_id + " | Notification ID : " + notification_id);
  
  return admin.firestore().collection("Users").doc(user_id).collection("NotificationsN").doc(notification_id).get().then(queryResult =&gt;{
  
      const from_user_id = queryResult.data().from;
  
      const from_data = admin.firestore().collection("Users").doc(from_user_id).get();
      const to_data = admin.firestore().collection("Users").doc(user_id).get();
  
      return promise.all([from_data, to_data]).then(result =&gt;{
  
        const from_name = result[0].data().name;
        const to_name = result[1].data().name;
  
        console.log("FROM : " + from_name +" TO : " + to_name)
        return null;
      }).catch(error =&gt; {
     console.error(error);
    res.error(500);
   });
  
    }).catch(error =&gt; {
    console.error(error);
    res.error(500);
    });
   });
  </code></pre>