在 Firestore 的安全设置中,您可以设置写入/读取数据的条件。目前我有这段代码:
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read: if request.auth != null && request.time <
resource.data.timeCreated + duration.value(1, 'h');
allow write: if request.auth != null;
}
}
}
现在我想限制写入,用户只能每5分钟发送一次数据。我该如何实现?