가이드
Firebase Firestore에 대한 튜토리얼
Firebase Cloud Firestore용 capgo/capacitor 플러그인
Capacitor 플러그인으로 Firebase Cloud Firestore 사용
설치
bun add @capgo/capacitor-firebase-firestore
bunx cap sync
이 플러그인이 제공하는 것
addDocument- 지정된 데이터로 컬렉션에 새로운 문서를 추가합니다.setDocument- 지정된 참조에 의해 참조되는 문서에 쓰기. 만약 문서가 아직 존재하지 않으면 새로 생성됩니다.getDocument- 지정된 참조에 의해 참조되는 문서를 읽습니다.updateDocument- __CAPGO_KEEP_0__을 참조하는 지정된 참조에 대한 문서를 업데이트합니다.
예시 사용
addDocument
컬렉션에 지정된 데이터와 함께 새로운 문서를 추가합니다.
import { FirebaseFirestore } from '@capgo/capacitor-firebase-firestore';
await FirebaseFirestore.addDocument({} as AddDocumentOptions);
setDocument
__CAPGO_KEEP_0__을 참조하는 지정된 참조에 대한 문서에 쓰기. 만약 문서가 아직 존재하지 않으면 새로 생성됩니다.
import { FirebaseFirestore } from '@capgo/capacitor-firebase-firestore';
await FirebaseFirestore.setDocument({} as SetDocumentOptions);
getDocument
__CAPGO_KEEP_0__을 참조하는 지정된 참조에 대한 문서를 읽습니다.
import { FirebaseFirestore } from '@capgo/capacitor-firebase-firestore';
await FirebaseFirestore.getDocument({} as GetDocumentOptions);
updateDocument
__CAPGO_KEEP_0__을 참조하는 지정된 참조에 대한 문서를 업데이트합니다.
import { FirebaseFirestore } from '@capgo/capacitor-firebase-firestore';
await FirebaseFirestore.updateDocument({} as UpdateDocumentOptions);
전체 참조
- GitHub https://github.com/Cap-go/capacitor-firebase/tree/main/packages/firestore
- 문서: /docs/plugins/firebase-firestore/
capgo에서 계속 @capgo/capacitor-firebase-firestore를 사용하는 경우
__CAPGO_KEEP_0__을 사용하는 경우 Capgo의 @capgo/capacitor-firebase-firestore를 사용하여 자연스러운 플러그인 작업을 계획하고 연결하세요. Capgo 플러그인 디렉토리 Capgo 플러그인 디렉토리에서 제품 워크플로우 Capacitor 플러그인들에 의해 Capgo Capacitor 플러그인들에 의해 Capgo의 구현 세부 사항 플러그인을 추가하거나 업데이트 플러그인을 추가하거나 업데이트하는 구현 세부 사항 아이오닉 엔터프라이즈 플러그인 대안 아이오닉 엔터프라이즈 플러그인 대안의 제품 워크플로우 Capgo Native Builds for the product workflow in Capgo Native Builds.