title: Getting a Cloud Firestore document reference from a documentSnapshot
body: <h1>The issue</h1>
  
  <p>I'm trying to retrieve the document reference from a query.  My code returns <code>undefined</code>.  I can get the path by extracting various parts of <code>documentSnapshot.ref</code>, but this isn't straightforward.</p>
  
  <p>What I'd like to return is a reference which I can then later use to <code>.update</code> the document, without having to specify the collection and use <code>documentSnapshot.id</code></p>
  
  <p>The documentation for the <code>path</code> property is <a href="https://cloud.google.com/nodejs/docs/reference/firestore/0.11.x/DocumentReference#path" rel="noreferrer">here</a></p>
  
  <h1>My code</h1>
  
  <pre><code>const db = admin.firestore();
  
  return db.collection('myCollection').get().then(querySnapshot =&gt; {
    querySnapshot.forEach(documentSnapshot =&gt; {
      console.log(`documentReference.id   = ${documentSnapshot.id}`);
      console.log(`documentReference.path = ${documentSnapshot.path}`);
      // console.log(`documentReference.ref = ${JSON.stringify(documentSnapshot.ref)}`);
    });
  });
  </code></pre>
  
  <h1>Output</h1>
  
  <pre><code>documentReference.id   = Jez7R1GAHiR9nbjS3CQ6
  documentReference.path = undefined
  documentReference.id   = skMmxxUIFXPyVa7Ic7Yp
  documentReference.path = undefined
  </code></pre>