【问题标题】:How to get the id's for all documents without the data in a parsed collection in Firebase Firestore?如何在 Firebase Firestore 中解析集合中没有数据的情况下获取所有文档的 ID?
【发布时间】:2019-09-13 02:31:36
【问题描述】:

我正在尝试从已解析的集合中获取所有文档的所有 ID,而不为获取文档数据付费。如果我使用下面的代码,我是否需要为接收数据付费?

  db.collection("owners").get().then(function(querySnapshot) {
      querySnapshot.forEach(function(doc) {
          console.log(doc.id);
      });
  });

这个数据库:

【问题讨论】:

    标签: javascript firebase google-cloud-firestore


    【解决方案1】:

    是的,您将更改为集合中的每个文档读取的文档。不阅读文档就无法做到这一点。

    How to get a list of document IDs in a collection Cloud Firestore?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-12-10
      • 1970-01-01
      • 2021-07-01
      • 2020-10-23
      • 2023-02-25
      • 2021-05-09
      • 2021-02-16
      • 1970-01-01
      相关资源
      最近更新 更多