document

    [Firebase] Firestore 에서 데이터 다루기

    Firestore 의 데이터는 Collection(컬렉션) 과 Document(문서) 로 되어있다. Collection > Document 로 되어있는데, 각 문서는 {key: value} 형식으로 들어가있으며 Collection 이 들어가도 된다. Document 불러오기 하나의 Document 불러오기 const docRef = doc(firestore, 'myCollection', 'doc1'); const docSnap = await getDoc(docRef); if (docSnap.exists()) { console.log('Document data:', docSnap.data()); } 모든 Document 불러오기 // 'myCollection' collection 의 모든 document ..