, 당신은 문서에서 documentatin https://firebase.google.com/docs/firestore/query-data/get-data
에 따라이 방법을 하나의 문서를 검색 할 수 있습니다 : -
다음 예는 검색하는 방법을 보여줍니다 GET을 사용하여 단일 문서의 내용() :
var docRef = db.collection("cities").doc("SF");
docRef.get().then(function(doc) {
if (doc.exists) {
console.log("Document data:", doc.data());
} else {
console.log("No such document!");
}
}).catch(function(error) {
console.log("Error getting document:", error);
});
귀하의 경우 다음을 수행 할 수 있습니다 : -
const db = firebase.firestore()
db.collection('users')
.doc('currentUserID') // change to the current user id
.get().then((user)=>{
if(user.exists){
// now you can do something with user
console.log(user.data())
}
})