0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

SwiftでFirebase Coloud Firestoreを使ってみた!!

0
Posted at

初めに

個人開発の中で、データを保存する場所としてFirebase Cloud Firestoreを利用したので、備忘録としてFirestore初期設定の仕方と、使い方をまとめました。

1.Firestoreの初期設定

初期設定については以下の記事で解説しました。
【サンプルコードあり】Firebase Cloud FirestoreをSwiftUIで使ってみた

内容は、Firebaseのプロジェクトを作成する部分からはじめ、SwiftUIを利用して、Firestoreにデータを登録するまでです。

2.Firestoreの使い方

Firestoreへの基本的なデータの追加

Firestoreへ基本的なデータについては以下の記事にまとめています。
Firestoreの基本的な知識、コレクションやドキュメントについて説明してから、実際にFirestoreへデータの登録のしかたや、更新の仕方についてまとめました。以下の記事から見てください。
【Swift】Firebase Cloud Firestoreに値を追加・取得・削除をする

配列形式のオブジェクトを追加する方法

次に以下のような形のデータを登録し、更新、削除する方法についてまとめました。
自分ではこの形にたどり着くまでに時間を使ってしまいました。誰かが、効率的にこの形式にたどり着き、利用できたらと思います。

{
  "コレクション": {
    "ドキュメント": {
      "配列名": [
        [
          "データ1": "data1",
          "データ2": "data2",
          ....
        ],
        [
          "データ1": "data1",
          "データ2": "data2",
          ....
        ],
        ....
      ]
    }
  }
}

以下から読めます!!
【Firastore】ドキュメントの下に登録した配列 オブジェクトの値を追加、削除する(Swift)

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?