파이어베이스 문서 예제에 필요하신 내용이 나오는 것 같네요.
https://firebase.google.com/docs/firestore/query-data/get-data#get_a_document
방법1.
val docRef = db.collection("요기").document("요기")
docRef.get()
.addOnSuccessListener { document ->
if (document != null) {
Log.d(TAG, "DocumentSnapshot data: ${document.data}")
document.data.get("요기")
} else {
Log.d(TAG, "No such document")
}
}
.addOnFailureListener { exception ->
Log.d(TAG, "get failed with ", exception)
}
방법2.
val docRef = db.collection("요기").document("요기")
docRef.get().addOnSuccessListener { documentSnapshot ->
val somObject = documentSnapshot.toObject<요기>() // documentSnapshot을 커스텀 오브젝트로 변환
//someObject에서 원하는 필드 축출.
}
"요기"라고 된 부분을 님의 구조와 비교해 보세요. 함수이름을 보면 collection, document, field 이런 식으로 되어 있습니다. 파이어스토어도 똑같이 되어 있구요.