I am trying to access the dictionary in the "workload" in my document in firestore, however I am having difficulties trying to do so. This is my code:
async addTask() {
const projectDoc = await getDoc(doc(db, "projects", "TestingNewNew"))
const projectData = projectDoc.data();
const employeeWorkload = projectData.workload
console.log(employeeWorkload)
console.log(employeeWorkload["Jimmy"])
}
When I console.log() the entire dictionary, I get the correct output, however when I try to access the dictionary through a particular, my console.log() reads undefined.
This is how my document in firestore looks
I tried many differents ways. I tried using the JSON.parse(JSON.stringify()) method, but it still doesn't work. Please advice me on how I can approach the problem. Thank you.