dalenguyen / firestore-import-export

An application that can help you to backup and restore from Cloud Firestore | Firebase
https://www.npmjs.com/package/firestore-export-import
401 stars 109 forks source link

Use a value from key-value pair to be the doc id #36

Open kyawzazaw opened 4 years ago

kyawzazaw commented 4 years ago

For example, I would like my doc id to be the value from the key-value pair courseid json

dalenguyen commented 4 years ago

@kyawzazaw you can run a loop locally to reformat the json file to bring out the courseid before importing back to the firestore.

You try this package, it's more up-to-date: https://github.com/dalenguyen/firestore-backup-restore

kyawzazaw commented 4 years ago

@dalenguyen Thanks for your response. I am not quite clear what you mean.

Are you suggesting me to reformat the json file? And then process it? Does the other package have this functionality?

dalenguyen commented 4 years ago

@kyawzazaw, in order to have the structure based on your need. You have to follow the format of your file in order to import correctly.

https://github.com/dalenguyen/firestore-import-export/blob/master/import-to-firestore.json