Firestore中的空文档是否已删除? [英] Are empty documents in Firestore deleted?

查看:59
本文介绍了Firestore中的空文档是否已删除?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我阅读了此问题,其中空文档将在Google Firestore中删除.这仍然是真的吗?我的一个收藏集中有空文档,它们已经存在了几个月,所以我猜这是不对的了.谁能启发我?

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?

推荐答案

不会,没有任何东西可以自动删除空文档,因为您可能有充分的理由希望这些空文档存在.

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.

这篇关于Firestore中的空文档是否已删除?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆