How does Firebase Firestore emulator work?

早过忘川 提交于 2021-01-28 21:51:13

问题


So far I've been using Firebase Hosting and Functions emulators. But now I'm writting a function that will run based on a Firestore trigger, so I'm looking into the Firestore emulator for development.

But how does it work? Does it mimics Firestore completely? Will I be able to read my current Firestore data that it's saved on server? And what if I update, create or delete change documents, will I be really changing them in my real data as well?

I'll run it with:

firebase emulators:start --only hosting,functions,firestore


回答1:


The Firestore emulator suites gives you just enough functionality to test locally. It is not a full copy of what the cloud services actually do.

The Firestore emulator does not let you read and write data stored on the server. You have to populate the database locally in order to test locally.

If you want to use data hosted in the cloud service instead, then don't use the emulator - just access your project as normal.



来源:https://stackoverflow.com/questions/58932851/how-does-firebase-firestore-emulator-work

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