Are empty documents in Firestore deleted?

随声附和 提交于 2021-02-08 11:29:18

问题


I read in this question that empty documents will be deleted in Google Firestore. Is this still true? I have empty documents in one of my collections, they've been there for months, so I guess is not true (anymore). Can anyone enlighten me?


回答1:


Nope, there is nothing in place to automatically delete empty documents, as you might have a valid reason for wanting those empty documents to exist.

That said, I'd typically recommend putting a dummy field into a document that you create, even if you have no use for that field. The reason for that is that some tools may reject empty documents or not store them. But there's nothing on the database itself that does this, and I can't even call out any of such tools at the top of my head right now.



来源:https://stackoverflow.com/questions/65604626/are-empty-documents-in-firestore-deleted

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