问题
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