Firestore DB - documents shown in italics

后端 未结 3 1133
无人及你
无人及你 2020-11-28 15:27

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

3条回答
  •  悲&欢浪女
    2020-11-28 15:53

    In firestore, Documents shown in italics because of,

    1. delete collection or document with sub collection, sub documents.
    2. Adding collection and documents to an empty document.

    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 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".

提交回复
热议问题