I'm trying to read information from a Firebase collection in React, but I can only read one using this code. Can anyone help me?
This is my code, returns only one element
async function(){ const docRef = doc(db, "transactions/yaounde/income/GWL5xaGgrSvmaYNXhSLx"); const docSnap = await getDoc(docRef); if (docSnap.exists()) { console.log("Document data:", docSnap.data()); } else { console.log(docSnap.data()) console.log("No such document!"); } };
I've tried reducing the number of quoted midsections but it returns undefined
Excerpted from the Firebase documentation on Reading multiple documents from a collection一>: