i am trying to display data from a collection in firebase to my html page, i managed to figure out the following code but my data is displayed as undefiened.. Does anyone have any solution to this?
Here is my code
db.collection("patients").onSnapshot(snapshot => {
setupGuides1(snapshot.docs);
});
const guideList1 = document.querySelector('.patients');
//setup the patients
const setupGuides1 = (data) => {
let html = '';
data.forEach(doc => {
const patients = doc.data();
table= `<table"><tr><td style="text-align: center">${patients.name1}"</td></tr><tr><th style="text-align: center">${patients.phone1}</th></tr><tr style=""padding-top:20px;><td style="text-align: center">${patients.specialist1}</td></tr><tr><td style="text-align: center">${patients.date}</td></tr></table>
`;
html += table;
});
guideList1.innerHTML = html;
}