Clear Firestore database of all data?

大兔子大兔子 提交于 2021-02-20 06:03:33

问题


After over a year of development, I have a pretty well developed site. Now I'm going to open it up for a public beta but I need to clear my Firestore of all it's data (it's all test data). Is there a simple way to do this or do I have to delete every single entry by hand? (There are over 1000 entries). The only realistic option I can think of at the moment is to switch Firebase projects to a new one, which is not something I want to do.

Solution: After reaching out to Firebase support, I was given the following CLI command to run, which did the trick:

// THIS WILL PROMPT CONFIRMATION AND WILL USE ACTIVE PROJECT
firebase firestore:delete --all-collections

// !!! WARNING !!! THIS WILL NOT PROMPT CONFIRMATION AND WILL USE ACTIVE PROJECT
firebase firestore:delete --all-collections -y

Remember to use caution, as this will wipe your entire Firestore database.

来源:https://stackoverflow.com/questions/53419891/clear-firestore-database-of-all-data

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