简体   繁体   中英

How to import CSV files into Firebase

I see we can import json files into firebase.

What I would like to know is if there is a way to import CSV files (I have files that could have about 50K or even more records with about 10 columns). Does it even make sense to have such files in firebase?

I can't answer if it make sense to have such files in Firebase, you should answer that.

I also had to upload CSV files to Firebase and I finally transformed my CSV into JSON and used firebase-import to add my Json into Firebase.

there's a lot of CSV to JSON converters (even online ones). You can pick the one you like the most (I personnaly used node-csvtojson ).

I've uploaded many files (tab separated files) (40MB each) into firebase. Here are the steps:

  1. I wrote a Java code to translate TSV into JSON files.
  2. I used firebase-import to upload them. To install just type in cmd:

npm install firebase-import

One trick I used on top of all the one already mentioned is to synchronize a google spreadsheet with firebase.

You create a script that upload directly to firebase db base on row / columns. It worked quite well and can be more visual for fine tuning the raw data compared to csv/json format directly.

Ref: https://www.sohamkamani.com/blog/2017/03/09/sync-data-between-google-sheets-and-firebase/

Here is the fastest way to Import your CSV to Firestore:

  1. Create an account in Jet Admin
  2. Connect Firebase as a DataSource
  3. Import CSV to Firestore

Ref: https://blog.jetadmin.io/how-to-import-csv-to-firestore-database-without-code/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM