title: Firestore - How to get document id after adding a document to a collection
body: <p>Is there a way to acquire the document id that was generated after adding a document to a collection? </p>
  
  <p>If I add a document to a collection that represents a "post" in a social media app, I want to get that document id and use it as a field in another document in a different collection.</p>
  
  <p>If I can't get the document Id that was generated after adding a document, should I just compute a random string and supply the id when creating the document instead? That way I can use that same string as the field in my other document?</p>
  
  <p>Quick structure example:</p>
  
  <pre><code>POST (collection)
      Document Id - randomly generated by firebase or by me
  USER (collection)
      Document Id - randomly generated by firebase
         userPost: String (this will be the document id 
                           in the post collection that I'm trying to get)
  </code></pre>