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