Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not backing up documents with no fields but with subcollections #28

Open
martinkronstad opened this issue Apr 6, 2018 · 2 comments
Open

Comments

@martinkronstad
Copy link

I have a database with some documents that have subcollections, but no fields.

like this:

/orgdata/ORGID/firstSubCollection
/orgdata/ORGID/secondSubCollection
/orgdata/ORGID/thirdSubCollection

The document ORGID has no fields, since it is really just a sepeator for different userspaces.

@manwithsteelnerves
Copy link

Documents with no fields and collections alone are not valid on firestore. Those shouldn't be accessible too.
The only option is to add at least one dummy field to make it accessible correctly.

@atlanteh
Copy link

@manwithsteelnerves I think that's not true. Please see here:
https://firebase.google.com/docs/firestore/data-model#subcollections

Warning: Deleting a document does not delete its subcollections!
When you delete a document that has associated subcollections, the subcollections are not deleted. They are still accessible by reference. For example, there may be a document referenced by db.collection('coll').doc('doc').collection('subcoll').doc('subdoc') even though the document referenced by db.collection('coll').doc('doc') no longer exists. If you want to delete documents in subcollections when deleting a document, you must do so manually, as shown in Delete Collections.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants