Closed germanandrade closed 6 years ago
I just found a way to insert the users as subcollection, instead of use
Hi @germanandrade, there's a subcollection argument that you can use to add the subcollection, but your method still works :)
Hi @dalenguyen thanks for this library. Can you pls let me know what the argument for adding the subcollection is? thanks
Hi @samyoungnyc, please use this package for the updated features: https://github.com/dalenguyen/firestore-backup-restore
OK - I am using it- when importing a particular collection/subcollection - do I have to name the collection in the restore
method call? Is that what the refs
option is for?
Example:
firestoreService.restore('userCollection.json', {
refs: ['refKey', 'arrayRef'],
});
@samyoungnyc, for subcollection, you have to structure your JSON file by following the example in order to import the subcollection. https://github.com/dalenguyen/firestore-backup-restore/blob/master/test/import-array-to-firestore.json
It should be inside a subCollection object.
I have a simple database with games>users and when I get the exported I have a json like this
But once i import that i have this:
Instead of something like this:
Is there any way to accomplish that?
Btw nice project!
Thank you for your time!
Regards,
Germán.