I have the database design below.
I was wondering how I would be able to use an id like KeXrsroFOeMs4XNjgC7h
to retrieve the value for that document. Here is my current code:
db.collection('users',).where(id, '==', id)
.get().then(function(querySnapshot) {
if (querySnapshot.size > 0) {
// Contents of first document
resolve(querySnapshot.docs[0].data());
} else {
resolve("No such document!");
}
})
.catch(function(error) {
console.log("Error getting document: ", error);
});