Can someone explain this to me. I am working with node-firestore-backup-restore-master backup script for Firestore from github. Got it working but it only reads one docume
If you create documents with sub-documents and then delete the top level document from an SDK, the delete is not recursive. So while the top-level document is gone, its sub-documents remain.
The document IDs for these are shown as italicized ids in the UI: these documents do not actually exist, but we show them so that you can navigate to the sub collections.
Since there is no document anymore, the document itself will not show up in query results.
This happens in two cases:
if you delete documents with subcollections
if you create directly something like "/collection/document(1)/collection/document(2)" instead of creating it in two steps:
And look like if you are in any of these cases you can not list "document(1)" which is a quite strange way of working because they don't exist as "documents" (this is way they are marked in 'italic') but they "exist" as references to subcollections.
In firestore, Documents shown in italics because of,
The italics documents are not shown in your app, it can't fetched, only way to do this is directly specify the exact path and name of the document.
SOLUTION:
instead of adding only one collection to empty document, add one empty field in that document before adding collection.
In android I add an empty hash map to the field. but won't shown in database Here my example code:
Map<String ,Object> dummyMap= new HashMap<>();
DocumentReference df=db.collection("col1").document("doc1");
df.set(dummyMap); // add empty field, wont shown in console
df.collection("your collection name");
The dummyMap and your collection are in same document "doc1".