title: Converting firebase 8 code to firebase 9 code (web, javascript) to fetch collection within collection
body: <p>Hello I would like to convert the following firebase 8 code to firebase 9 and have no clue how to do it - any help would be welcome!</p>
  <p>This piece of code should go inside the userDoc and then fetch the collection that is insdie that document and return all of the posts that belong to that user</p>
  <pre><code>if (userDoc) {
      user = userDoc.data()
      const postsQuery = userDoc.ref
          .collection('posts')
          .where('published', '==', true)
          .orderBy('createdAt', 'desc')
          .limit(5)
      posts = (await postsQuery.get()).docs.map(postToJSON)
  }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/dv652.png" rel="nofollow noreferrer">enter image description here</a></p>