【发布时间】:2018-12-16 15:20:52
【问题描述】:
当我在 firebase 控制台中看到我的数据时,它会如下所示
我正在编写 Firestore 安全规则来保护数据。
安全规则:
match /wallpost/{wallpostId} {
allow read: if true;
allow list: if request.query.limit <= 10;
allow create, update, delete: if resource.data.createdBy == request.auth.uid && request.resource.data.createdBy is string && request.resource.data.description is string
// && **HERE I WANT VALIDATE TAG - WHICH IS A ARRAY OF STRING**
}
有人知道如何验证 Firestore 中的数据数组吗?
(我的想法:如果我们不能在 firestore 中验证数组,任何人都可以注入大量垃圾数据并破解 firestore。所以我们不应该允许用户直接写入数组或对象,而是使用 firestore 函数来做这个映射和将数据排列在正确的位置)
请帮帮我...
【问题讨论】:
标签: google-cloud-firestore firebase-security