I'm currently facing an issue with accessing the dictionary stored in the "workload" field of a document in Firestore. Here is the snippet of code I am struggling with:
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"])
}
Even though I can correctly log the entire dictionary, when I try to access a specific key within it, my console shows undefined.
This is how the document appears in Firestore:
I have attempted various solutions such as using JSON.parse(JSON.stringify()) method, but unfortunately, none have worked for me. Any suggestions on how to troubleshoot this problem would be greatly appreciated. Thank you.