메인 콘텐츠로 건너뛰기

가이드

Firebase Cloud Firestore에 대한 튜토리얼

@capgo/capacitor-firebase-firestore 사용

Capacitor Firebase Cloud Firestore 플러그인.

설치

bun add @capgo/capacitor-firebase-firestore
bunx cap sync

이 플러그인은 노출합니다.

  • addDocument - 지정된 데이터와 함께 컬렉션에 새로운 문서를 추가합니다.
  • setDocument - 지정된 참조에 의해 참조되는 문서에 쓰기. 만약 문서가 아직 존재하지 않으면 새로 생성됩니다.
  • getDocument - 지정된 참조에 의해 참조되는 문서를 읽습니다.
  • updateDocument - 지정된 참조에 의해 참조되는 문서의 필드를 업데이트합니다.

예시 사용

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

지정된 참조에 의해 참조되는 문서의 필드를 업데이트합니다.

import { FirebaseFirestore } from '@capgo/capacitor-firebase-firestore';

await FirebaseFirestore.updateDocument({} as UpdateDocumentOptions);

전체 참조

Using @capgo/capacitor-firebase-firestore에서 계속하세요.

__CAPGO_KEEP_1__을 사용하는 경우 capgo/capacitor-firebase-firestore을 사용하여 __CAPGO_KEEP_0__ Plugin Directory와 연결하여 Capgo Plugin Directory에서 Capgo 제품 워크플로우를 연결하여 __CAPGO_KEEP_1__에서 개발한 Capgo 플러그인 Capacitor 플러그인에서 Capgo의 구현 세부 정보를 확인하여 for the implementation detail in Capacitor Plugins by Capgo, 플러그인을 추가하거나 업데이트에서 구현 세부 정보를 확인하여 for the implementation detail in Adding or Updating Plugins, Ionic Enterprise Plugin Alternatives Ionic Enterprise Plugin Alternatives 제품 워크플로우에서 Capgo Native Builds Capgo Native Builds 제품 워크플로우에서