【问题标题】:Gcloud Firestore emulators lost the data when restartGcloud Firestore 模拟器在重启时丢失了数据
【发布时间】:2020-06-02 07:21:11
【问题描述】:

我将firestore emulator 用于我的python 项目。

我使用这个命令启动它。

gcloud beta emulators firestore start --host-port=localhost:8080

如果我关闭 firestore 并再次运行它,它会在保存文档并执行其他操作后丢失 所有数据。我希望firestore 保留数据,直到我自己清除数据,这可能吗?

【问题讨论】:

    标签: google-cloud-firestore firebase-tools


    【解决方案1】:

    听起来您正在寻找:

    • emulators:export从模拟器中导出数据
    • --import 标志用于在启动时将导出的数据传递给模拟器

    另请参阅 exporting and importing emulator data 上的 Firestore 文档。

    【讨论】:

    • 不明白能否请您提供示例如何在上面的命令中运行它我正在使用此gcloud beta emulators firestore start --host-port=localhost:8080 启动emulator
    • firebase 文档看起来很有希望,但我收到了这个错误:ERROR: (gcloud.beta.emulators.firestore.start) unrecognized arguments: --import=./db (did you mean '--host-port'?) 这些标志是否仅适用于 firebase 用户而不适用于 gcloud?
    • 正确,这仅适用于 Firebase 模拟器 - 所以当您运行 firebase emulators:start 命令时。
    猜你喜欢
    • 2020-12-05
    • 2022-07-19
    • 2018-06-28
    • 1970-01-01
    • 2016-08-17
    • 1970-01-01
    • 2022-12-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多