가이드
파이어베이스 Firestore를 사용하는 방법은 Capacitor
Firebase Firestore를 사용하는 @capgo/capacitor
Capacitor는 Firebase Cloud Firestore를 위한 플러그인입니다.
설치
bun add @capgo/capacitor-firebase-firestore
bunx cap sync
이 플러그인이 제공하는 것
addDocument- 지정된 데이터와 함께 컬렉션에 새로운 문서를 추가합니다.setDocument- 지정된 참조에 대한 문서에 쓰기. 만약 문서가 아직 존재하지 않으면 새로 생성됩니다.getDocument- 지정된 참조에 대한 문서를 읽습니다.updateDocument- 지정된 참조에 대한 문서의 field를 업데이트합니다.
예시 사용
addDocument
지정된 데이터와 함께 컬렉션에 새로운 문서를 추가합니다.
import { FirebaseFirestore } from '@capgo/capacitor-firebase-firestore';
await FirebaseFirestore.addDocument({} as AddDocumentOptions);
setDocument
지정된 참조에 대한 문서에 쓰기. 만약 문서가 아직 존재하지 않으면 새로 생성됩니다.
import { FirebaseFirestore } from '@capgo/capacitor-firebase-firestore';
await FirebaseFirestore.setDocument({} as SetDocumentOptions);
getDocument
지정된 참조에 대한 문서를 읽습니다.
import { FirebaseFirestore } from '@capgo/capacitor-firebase-firestore';
await FirebaseFirestore.getDocument({} as GetDocumentOptions);
updateDocument
문서에 지정된 참조에 대한 문서의 field를 업데이트합니다.
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/
Using @capgo/capacitor-firebase-firestore
__CAPGO_KEEP_0__을 사용하여 @capgo/capacitor-firebase-firestore __CAPGO_KEEP_0__을 사용하여 Capgo 플러그인 목록 Capgo Plugin Directory에서 제품 워크플로우를 연결하세요. Capacitor Plugin Directory에서 Capgo에 의해 관리되는 플러그인 Capacitor 플러그인 구현 세부 사항에 대해 Capgo 플러그인에 의해 Capacitor 플러그인 추가 또는 업데이트 __CAPGO_KEEP_0__ 플러그인 구현 세부 사항에 대해 플러그인 추가 또는 업데이트 아이온틱 엔터프라이즈 플러그인 대안 __CAPGO_KEEP_0__ 플러그인에 대한 제품 워크플로우, 아이온틱 엔터프라이즈 플러그인 대안, 및 Capgo 네이티브 빌드 Capgo 플러그인에 대한 제품 워크플로우, Capgo 네이티브 빌드.