I'm querying a collection for a specific document and trying to get the document-ID from the result of my query that is from type FirebaseFirestore.QuerySnapshot.
My actual query looks like this (I'm using async/await):
result = await db.collection("chatrooms").where("userA", "==", req.body.userA)
.where("userB", "==", req.body.userB).limit(1).get();
I tried with:
await result.docs.map(doc => {
return doc.id
})
But that gives me an undefined back.
What am I doing wrong?
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)