【问题标题】:How to access reference data field in firestore using Angularfire2?如何使用 Angularfire2 访问 Firestore 中的参考数据字段?
【发布时间】:2017-11-07 04:31:22
【问题描述】:

【问题讨论】:

    标签: angularfire2 google-cloud-firestore


    【解决方案1】:
    //SAVING...
    let ref = db.collection('nameOfCollection').doc('documentId').ref
         //Focus ".ref" at the end
    db.collection('otherCollection').doc('otherDocumentId').set({ nameRef:ref })
    
    
    //READING...
    db.collection('otherCollection').doc('otherDocumentId').ref.get().then(res=>{
       //this "res.data().nameRef" 
       //it is the same as  
       //"db.collection('nameOfCollection').doc('documentId').ref"
    })
    

    我不知道我能不能帮忙,但不幸的是我做了我能做的。 我还是不会说英语,对不起。

    【讨论】:

      猜你喜欢
      • 2018-06-15
      • 2018-11-20
      • 2018-08-20
      • 2018-07-07
      • 2019-01-16
      • 1970-01-01
      • 2019-01-12
      • 2022-07-01
      • 2018-09-26
      相关资源
      最近更新 更多