title: FIrebase Firestore onCreate Cloud Function Event Params Undefined
body: <p>I have tried following Firebase's documentation and other SO posts to access a parameter value for a cloud function I've successfully deployed.</p>
  
  <p>Unfortunately I've still been receiving a </p>
  
  <blockquote>
    <p>Type Error: cannot read property 'id' of undefined</p>
  </blockquote>
  
  <p>I've logged event.params and it is outputting as undefined, so I understand the issue, but am unsure how, syntactically, I'm supposed to derive the param value.</p>
  
  <p>Below is my js code for reference:</p>
  
  <pre><code>exports.observeCreate = functions.firestore.document('/pathOne/{id}/pathTwo/{anotherId}').onCreate(event =&gt; {
    console.log(event.params);
  
    //event prints out data but params undefined...
    const data = event.data()
  
    var id = event.params.id;
  
    return admin.firestore().collection('path').doc(id).get().then(doc =&gt; {
      const data = doc.data();
      var fcmToken = data.fcmToken;
  
      var message = {
        notification: {
          title: "x",
          body: "x"
        },
        token: fcmToken
      };
  
      admin.messaging().send(message)
        .then((response) =&gt; {
          console.log('Successfully sent message:', response);
          return;
        })
        .catch((error) =&gt; {
          console.log('Error sending message:', error);
          return;
        });
  
        return;
    })
  })
  </code></pre>