4
4

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 5 years have passed since last update.

FirestoreにCSVをインポートする

Posted at

基本的に以下の手順に従う。

Google公式のインポート・エクスポートの方法だと、エクスポートしたファイルを編集できないようで、自分で作成したExcelデータ(CSVデータ)をFirebaseに突っ込みたい時なんかには使えないようだった。

また上記だとプランをSparkからBlazeに変更しないといけないが、この方法ならたぶん変更しなくてもOK(ちなみに変更する必要があっても、インポートが終わったらSparkプランにすぐ戻せる)。

注意点としてはサービスアカウントのjsonデータは新しい秘密鍵の生成というボタンを押してダウンロードする形に変わっていたことと、それをローカルにダウンロードしたさいにserviceAccountのパスをちゃんとそのファイル名や位置に合わせて変更するくらい。


var serviceAccount = require("path/to/serviceAccountKey.json");

var serviceAccount = require("./[プロジェクトID]-firebase-adminsdk-[英数字]");
4
4
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
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?