How can I view database data when running Firestore local emulator?

强颜欢笑 提交于 2020-06-17 09:32:45

问题


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.

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

回答1:


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

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

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



来源:https://stackoverflow.com/questions/61704839/how-can-i-view-database-data-when-running-firestore-local-emulator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!