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!
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
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)
}