Cloud Firestore是否有审核记录?
我真的很喜欢Cloud Firestore的产品。但这有审计记录吗?
I really like the offering that's Cloud Firestore. But does it have an audit trail?
我为什么要问?虽然数据库的某些使用本质上是状态(例如,多人游戏),但对于其他用途,历史也很重要。另外,有时能够看到历史记录对于调试目的(时间旅行)很有用。
Why am I asking? While some use of databases is essentially "state" (e.g. multiplayer games), for other uses also the history matters. Also, at times being able to see the history would be useful for debugging purposes (time travel).
那么我要问的是什么意思,例如谁删除了此文档中的值或自文档创建以来曾接触过该文档的人?
So what's the means I would have to ask e.g. "who deleted a value in this document" or "who has touched this doc since its inception"?
人们是否在应用程序级别使用其他注释性文档来做到这一点,或者我是否可以启用某个设置,以便在后台自动创建此类文档? (然后,我可以像其他任何Firestore文档一样描述访问权限。)
Do people use additional commentary documents to do this at the application level, or can I just enable a setting somewhere that would create such a document behind the scene, automatically? (I could then describe access rights just as for any other Firestore document.)
附件,插件等也可以建议。我目前没有一个紧迫的用例,只是想了解Cloud Firestore的适合位置和不适合的位置。
Addons, plugins etc. can also be suggested. I don't have a pressing use case for this right now - just want to understand where Cloud Firestore would fit and where not.
顺便说一句,开始了解Cloud Firestore 系列在YouTube中简直很棒! :)
Btw, the Getting to know Cloud Firestore series in Youtube is plain awesome! :)
那么我要问的是什么意思,例如谁删除了此文档中的值或自文档创建以来曾接触过该文档的人??
So what's the means I would have to ask e.g. "who deleted a value in this document" or "who has touched this doc since its inception"?
Cloud Firestore不存储这样的元数据。如果您处于需要此类详细信息的位置,则需要创建一种存储它们的机制。因此,如果您想知道谁删除了某个特定值,则应创建一个对象数组,在其中应存储删除该值的用户的uid和时间戳。
Cloud Firestore dosn't store such metadata. If you find yourself in a position in which you need such details, you'll need to create a mechanism to store them. So in case you want to know who deleted a specific value, you should create an array of objects where you should store the uid of the user who deleted that value and a timestamp.
人们是否在应用程序级别使用其他评论文档
Do people use additional commentary documents to do this at the application level
是的,我们通常这样做。
Yes, we usually do.
还是可以在某个地方启用自动在后台创建此类文档的设置?
or can I just enable a setting somewhere that would create such a document behind the scene, automatically?
没有这样的设置是必要的。
There is no such a setting that can be neabled.
如果您需要历史记录,文档,下面的帖子给出了我的答案:
If you need a history version of the document, a possible schema that might help you is in my answer from the following post:
- Firestore: Version history of documents