【问题标题】:How to add a parent collection in firestore?如何在 Firestore 中添加父集合?
【发布时间】:2018-10-08 07:06:46
【问题描述】:

我想没有办法在 firestore 中创建父集合。 但是,可能有解决方案,所以我发布了这个。

我的数据库现在如下所示。

+ categories + stores + counters

商业模式变了,所以我需要把数据库模型改成这样。

Countries + U.S + Cities + LA + categories + stores + counters + NewYork + categories ...

有可能吗?

谢谢!

【问题讨论】:

    标签: firebase google-cloud-firestore


    【解决方案1】:

    没有简单的方法可以将文档移动到新结构中。您必须编写代码,通过单独读取现有文档、编写新文档和删除原始文档来重组所有文档和集合,以按照您想要的方式进行组织。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-06-04
      • 1970-01-01
      • 2021-12-21
      • 2020-01-05
      • 1970-01-01
      • 2022-01-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多