Tuesday 26 May 2020

Why does this give me undefined?

const SignUpForProject = (req, res) =>{ let dbContext = new DbContext().Initialize("projects"); let projectId = req.params.id let promise = dbContext.doc(projectId).get().then(snapshot => { let oldArray = snapshot["_fieldsProto"]["usersQueue"]["values"] console.log(oldArray) }) //let data = {usersQueue: newArray} //let project = dbContext.doc(projectId).update(data,{merge: true}) res.end() } IM trying to get array from firebase document. I get other thing correctly but the array gives me undefined?

Submitted May 26, 2020 at 12:28PM by draganov11

No comments:

Post a Comment