willhlaw / node-firestore-backup-restore

Google Firebase Firestore backup and restore tool
91 stars 24 forks source link

Backup of Collection with other collection but with empty document fields #22

Closed Jaimeer closed 6 years ago

Jaimeer commented 6 years ago

I have detected that if you have a collection that contains an empty document with no fields but with another collection, the data is not saved.

Collection_1

The Collection_2_1 is not saved because the Document_1 doesn't have fields, if you add a field to the Document_2, the data is saved in the backup process

NaturalLam commented 6 years ago

That's a FireStore issue, basically if you have this structure and you have the collection reference of Collection_1 (say ref), and call ref.get(), it does not return Document_2 as it's being regarded as empty. see this issue: https://stackoverflow.com/questions/48498342/firestore-query-documents-with-only-collections-inside?rq=1

willhlaw commented 6 years ago

I agree. Collections_2_1 are "orphaned" and a Firestore issue. Closing for now, but would be interested to see if anyone has thoughts for how to access the orphaned docs.