I tried to retrieve data with the following manner but it didn't work: Unhandled Rejection (TypeError): snapshot.val is not a function. (In 'snapshot.val()', 'snapshot.val' is undefined)
var companyScore, userScore;
firebaseApp.firestore().collection('JobPosting')
.doc(postId).get().then(snapshot => {
console.log("Snapshot");
console.log(snapshot);
companyScore = snapshot.val().score;
});
firebaseApp.firestore().collection('people')
.doc(currentUser.uid).get().then(snapshot => {
userScore = snapshot.val().score;
});
I guess I need a solution to get the snapshot data (supposedly a json or hash table), so that I can get the value under the index of score.