运行Firestore本地模拟器时如何查看数据库数据? [英] How can I view database data when running Firestore local emulator?

查看:107
本文介绍了运行Firestore本地模拟器时如何查看数据库数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设置了Firebase 本地仿真器套件,并且我的iOS应用程序已命中本地服务器.我想验证某些云功能(在文档写入时)是否按预期执行,但是我无法验证数据是否存在.我可以通过运行deploy并检查Firebase控制台数据库选项卡来做到这一点,但这只是在开发过程中可行的解决方案.我想我也可以从iOS客户端执行get,但是希望有一种更简单的方法来查看JSON.

I've setup the Firebase local emulator suite and have my iOS application hitting the local server. I'm wanting to verify whether some cloud functions (on document write) are executing as expected, but I can't validate whether the data is there or not. I can do this by running deploy and checking the Firebase console database tab, but that's only a viable solution during development. I suppose I could also do a get from the iOS client, but hoping there's an easier way to just view the JSON.

CLI打印出许多本地URL,但是没有任何我可以看到的数据:

The CLI prints out a number of local URLs but none have any data I can see:

✔  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

推荐答案

Firebase团队于2020年5月21日拥有

On May 21, 2020 the Firebase team has introduced the Emulator UI. One of the features available is data management for Firestore and Realtime Database

基本上,您必须确保至少安装了Firebase CLI 8.4.0版本

Basically you have to make sure to have Firebase CLI at least version 8.4.0 installed

使用firebase init初始化项目后,执行以下命令后,您便可以通过localhost:4000在Web浏览器中访问仿真器UI

Once you have initialised your project with firebase init, you'll be able to access the Emulator UI in your web browser at localhost:4000 after executing the following command

firebase emulators:start

这篇关于运行Firestore本地模拟器时如何查看数据库数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆