ガイド
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 Firebase Firestore を使用している場合 Capacitorを使用して@capgo/capacitor-firebase-firestore nativeプラグインの作業を計画し、接続する Capgo プラグインディレクトリ Capgo プラグインディレクトリの製品ワークフロー Capacitor Plugins by Capgo for the implementation detail in Capacitor Plugins by Capgo, __CAPGO_KEEP_0__ プラグイン __CAPGO_KEEP_1__ プラグインの追加または更新 プラグインの追加または更新の実装詳細 Capgo Native Builds for the product workflow in Capgo Native Builds.