【问题标题】:Angularfire Document Referance collectionAngularfire 文档参考集合
【发布时间】:2019-11-22 02:09:12
【问题描述】:
    return this.orderCollection.snapshotChanges().pipe(
      map(actions =>
        actions.map(a => {
          const data = a.payload.doc.data() as Order;
          const id = a.payload.doc.id;
          return { id, ...data };
        })
      )
    );
  }

现在如何在 angularfire2 中获取文档参考数据?

【问题讨论】:

    标签: javascript angular firebase google-cloud-firestore angularfire2


    【解决方案1】:

    您需要单独加载引用的文档。所以像:

    customerRef = a.payload.doc.get("customerId");
    customerRef.get().then((doc) => {
      console.log(doc.data());
    })
    

    【讨论】:

    猜你喜欢
    • 2019-11-13
    • 1970-01-01
    • 1970-01-01
    • 2018-12-13
    • 2015-12-10
    • 2018-07-01
    • 2018-10-09
    • 2012-07-30
    • 1970-01-01
    相关资源
    最近更新 更多