firebase - 运行 Firestore 本地模拟器时如何查看数据库数据?
问题描述
我已经设置了 Firebase本地模拟器套件,并让我的 iOS 应用程序访问本地服务器。我想验证某些云功能(在文档写入时)是否按预期执行,但我无法验证数据是否存在。我可以通过运行deploy
并检查 Firebase 控制台数据库选项卡来做到这一点,但这只是开发期间的可行解决方案。我想我也可以get
从 iOS 客户端做一个,但希望有一种更简单的方法来查看 JSON。
CLI 打印出许多本地 URL,但没有任何我能看到的数据:
✔ hub: emulator hub started at http://localhost:4400
✔ functions: functions emulator started at http://localhost:5001
i firestore: firestore emulator logging to firestore-debug.log
✔ firestore: firestore emulator started at http://localhost:8080
i firestore: For testing set FIRESTORE_EMULATOR_HOST=localhost:8080
解决方案
2020 年 5 月 21 日,Firebase 团队推出了模拟器 UI。可用功能之一是 Firestore 和实时数据库的数据管理
基本上你必须确保至少安装了 Firebase CLI 8.4.0 版本
使用 初始化项目后firebase init
,您将能够在localhost:4000
执行以下命令后在 Web 浏览器中访问 Emulator UI
firebase emulators:start
推荐阅读
- python - 如何复制列表并使所有项目均为小写?
- node.js - Express 路由器找不到路径“/”
- azure - 如何将 VS Code JS 调试器用于 Vue.js 应用程序和 Azure 静态 Web 应用程序模拟器 (swa)?
- c++ - 为什么只有在我大括号初始化对象时才需要从 int 到 float 的缩小转换?
- excel - 单击子形状时获取父形状的名称
- html - 如何在href代码中将文本放置在中心图像旁边?
- javascript - ReactJS:从一个页面导航到另一个页面
- arrays - 基于键值数组重新排序 ruby 中的哈希数组
- javascript - javascript promise resolve 不是一个函数
- c# - 低级键盘挂钩上的 ExecutionEngineException