I have a function which returns a list of objects, I need some way so that i can populate this data in local firestore emulator and not in actual cloud firestore instance. How can I achieve it?
Asked
Active
Viewed 1,716 times
1 Answers
14
The Firestore emulator can import data on startup by starting it with:
firebase emulators:start --import=./dir
The data to be imported has to be in a proprietary format though, so you'll want to convert your data into that format by:
- Writing it to the Firestore emulator using the regular Firestore API.
- Export the data to the import/export format by running
firebase emulators:export ./dir
. - And then import the data into the emulator on startup as shown above.

Raphael Rafatpanah
- 19,082
- 25
- 92
- 158

Frank van Puffelen
- 565,676
- 79
- 828
- 807