Firestore每小时或每天限制读取和写入,以防止用户在检查器中设置计时器 [英] Firestore limit reads and writes per hour or per day to prevent user setting a timer in the inspector

查看:135
本文介绍了Firestore每小时或每天限制读取和写入,以防止用户在检查器中设置计时器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习Firebase,可能会在生产中使用它.我找不到如何防止已登录的用户编辑javascript代码并每天自动触发成千上万次读取的操作,而我将不得不为此付费.据我所知,任何想增加我的Firebase账单的用户都可以通过编辑JavaScript代码来设置计时器,并每4秒钟在Firestore数据库中读写一次.如何防止用户每天或每小时的阅读率?

I am learning Firebase and I might use it in production. I can not find how to prevent a logged in user to edit javascript code and trigger thousands of reads per day automatically and that I will have to pay for. As far as I know, any user who would like to increase my firebase bill could set a timer by editing javascript code and read and write every 4 seconds where he can in the firestore database. How can you prevent a user read rate per day or hour?

推荐答案

无法设置Cloud Firestore的读取限制.

There is no way to set a read limit on Cloud Firestore.

您可以在安全规则中实现写限制,如以下答案所示:

You can implement a write limit in security rules as shown in this answer: How do I implement a write rate limit in Cloud Firestore security rules?. Alternatively you can pass all writes through Cloud Functions, where you can control the rate through your own code.

如果您已设置安全规则以将用户限制为他们需要访问的最少数据,并且认为您被滥用,请

If you've set your security rules to limit users to the minimum data they need to be able to access, and think you're being abused, reach out to Firebase support for personalized help in troubleshooting.

这篇关于Firestore每小时或每天限制读取和写入,以防止用户在检查器中设置计时器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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