Collection

Collection 과 Map (왜 Map 은 Collection 을 extends 하지 않을까?)
Collection Interface 다양한 자료구조들의 부모(?) 이며 iterable 하다 (순회할 수 있다, Iterable 인터페이스를 extends 했다). 그리고 하나의 값만 추가할 수 있다. 여기 Collection interface 를 extends 한 자료구조들 그림에서 알 수 있듯이, Collection (Interface) 는 Iterable (Interface) 를 extends 하고 있다. 그리고 List, Queue, Set (Interface) 들은 Collection (Interface) 를 extends 하고 있다. 그리고 각각의 구현 클래스 들은 Set, List, Deque 등을 implements 하고 있다. List - ArrayList, LinkedList, Vec..

[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 ..