【问题标题】:How to get the keys in Firestore?如何在 Firestore 中获取密钥?
【发布时间】:2017-11-08 14:43:32
【问题描述】:

我尝试仅获取最后一个集合的密钥

invoices
  -uid
    - invoice
        -uid
          -data

如何使用 Firestore 和 angularfire2 v5 访问我收藏的密钥?

【问题讨论】:

    标签: angular firebase angularfire2 google-cloud-firestore


    【解决方案1】:

    好的,这对我有用

     getSnapshot(uid) {
      this.collection = this.fb.collection('invoices').doc(uid).collection('invoice');
      return this.collection.snapshotChanges().map(actions => {
        return actions.map(item => {
          return { id: item.payload.doc.id, ...item.payload.doc.data() }
        });
      });
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-26
      • 2019-09-17
      • 2018-11-29
      • 2019-01-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多