title: Referencing a new document created in Firestore
body: <p>When I add a new document how can I reference the newly created document's data property?</p>
  
  <p>For example:
  <a href="https://firebase.google.com/docs/firestore/manage-data/add-data" rel="nofollow noreferrer">https://firebase.google.com/docs/firestore/manage-data/add-data</a></p>
  
  <pre><code>// Add a new document with a generated id.
  let addDoc = db.collection('cities').add({
    name: 'Tokyo',
    country: 'Japan'
  }).then(ref =&gt; {
    console.log('Added document with ID: ', ref.id);
    console.log(ref.data()); // &lt;&lt; Errors!
  });
  </code></pre>