ガイド
Firebase 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);
フル リファレンス
- GitHub: https://github.com/Cap-go/capacitor-firebase/tree/main/packages/firestore
- ドキュメント: /docs/plugins/firebase-firestore/
Keep going from Using @capgo/capacitor-firebase-firestore
Capacitor を使用している場合 Using @capgo/capacitor-firebase-firestore ファイアベースストア Capgo Plugin Directory for the product workflow in Capgo Plugin Directory, Capacitor Plugins by Capgo for the implementation detail in Capacitor Plugins by Capgo, プラグインの追加または更新 プラグインの実装詳細 Ionic Enterpriseプラグインの代替 Ionic Enterpriseプラグインの代替の製品ワークフロー Capgo Native Builds for the product workflow in Capgo Native Builds.