❤️‍🔥

ゼロから始めるFirestoreその1~Cloud Firestoreデータベースの作成手順~

2025/03/05に公開

こんにちは、ワニかず@40歳 出戻りエンジニアです。
今回はCloud Firestoreデータベースの作成手順をまとめました。

手順

  1. プロジェクトを新規作成
    作成の方法はこちらの記事でまとめていますのでご覧ください。
    https://zenn.dev/40_comeback_eng/articles/86cc4c24f7417b

  2. コンソールの左側のメニューから「Firestore Database」を探してクリック

  3. 「データベースを作成」をクリック

  4. ロケーションを「asia-northeast1 (Tokyo)」にして次へをクリック

  1. 今回は、デバッグのために設定しているため、「テストモードで開始する」を選択して「作成」をクリック
  1. 次の画面が出れば設定完了です。

Firestoreデータベースを作成していないと?

ターミナルで

firebase init

を実行し、

Firebase: Configure security rules and get started for Firestore

を選択すると、

Error: It looks like you haven't used Cloud Firestore in this project before. Go to https://console.firebase.google.com/project/xxxxxxxx/firestore to create your Cloud Firestore database.

というようなエラーが出る際は、プロジェクトでCloud Firestoreがまだ使用されていないことを示しています。解決するためには、提示されているURLにアクセスしてCloud Firestoreデータベースを作成する必要があります。

Discussion