Prompt: There are 5 products. Each product has 5 video reviews. These reviews are nested in the following data structure.
products > docs > productReviewClips > docs {videoUrl: https://videoclip.mp4, uid: 1234}.
Each productReviewClips doc has a videoUrl.
Am I querying the videoUrls from all the products the wrong way?
const [feed, setFeed] = useState([]);
useEffect(() => {
firestore.collection('products').doc().collectionGroup('productReviewClips')
.onSnapshot((snapshot) => {
// console.log(JSON.stringify(snapshot) + "1")
setFeed([...snapshot.docs.map((doc) => {
return {
...doc.data(),
documentID: doc.id,
};
})
])
})
},
[])