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

How to import to Firestore With An Auto ID #13

Closed artistic closed 5 years ago

artistic commented 5 years ago

Hie Im still a newbie to Firestore. I have the import working when i enter a manual ID like : { "menu" : {

    "1" : {
        "menu_item" : "Menu 1",
    },
    "2" : {
        "menu_item" : "Menu 2",
    }

} }

but i would like to let Firestore auto generate the ID Please help. Thank you in advance

dalenguyen commented 5 years ago

Hi @artistic, you can try this guide and run a loop to create a document without an ID.

https://github.com/dalenguyen/firebase-functions-helper/blob/master/docs/firestore.md#5-create-a-new-document-without-an-id