title: Value for argument "documentPath" is not a valid resource path. Path must be a non-empty string
body: <p>I want to write a cloud function  that listens to whether a new document is created in the <code>following</code> subcollection of some document of <code>users</code>. However, the user document upon previous creation may not have a <code>following</code> subcollection. </p>
  
  <p>In other words, I want a cloud that responds to <code>db.collection(“users”).doc(“doc_id1”).collection(“following”).doc(“doc_id2”).set(new_document)</code>
  , and I have written the cloud function to be</p>
  
  <pre><code>exports.create_friend_request_onCreate = functions.firestore
    .document("users/{user_id}/{following}/{following_id}")
    .onCreate(f2);
  </code></pre>
  
  <p>And implementation of  <code>f2</code> is written in some other file</p>
  
  <pre><code>exports.f2 = async function(snapshot) {
   //some code
  }
  </code></pre>
  
  <p>However upon creation the document in the subcollection, I get the following error </p>
  
  <p><code>Error: Value for argument "documentPath" is not a valid resource path. Path must be a non-empty string.</code></p>
  
  <p>Can someone explain to me what is wrong here?</p>