问题描述
我使用 Angular 和 Firestore 开发了一个示例应用程序.我在大约2个月前部署了我的应用程序,此后一直运行良好.
I developed a sample application using Angular and Firestore.I deployed my application about 2 months ago and since then always has worked great.
但是,在上周,我注意到在使用了几个小时的客户端脱机"错误后,该应用程序被阻止了.我发现使用2小时后,我超出了每天阅读操作的配额.
In the last week, however, I noticed that the application is blocked after a couple of hours of usage for "client offline" error.I found out that after 2 hours of usage I exceed the daily quota of reading operations.
限制为0,05个百万次操作.但是通常我在一小时内进行30-40次操作,在最后几天之前我从未出错.
The limit is 0,05 milions operations.But normally I make 30-40 operations in a hour and I never got error before the last days.
有什么变化吗?
谢谢
推荐答案
在Google网上论坛上询问了此问题之后,名为迈克尔·莱恩鲍尔(Michael Lehenbauer)回答,并提供以下信息:
After this question was asked on Google Groups, a user called Michael Lehenbauer replied with the following:
因此,除非您限制执行的读取操作,否则将读取集合中的所有文档或父文档,这会在数据库扩展后引发许多请求(这将解释应用程序为何能够正常工作).
So unless you limit the reads performed, all documents in the collection or a parent document are read which can lead to many requests once your database grows (Which would explain why the app worked before).
执行此操作的一种可能的解决方法是将数据缓存在本地某个位置,并在一段时间后刷新它,或者在您的请求中添加一个limit子句.
A possible workaround to do this would be to cache the data somewhere locally and refresh it after some time or to add a limit clause to your requests.
这篇关于Firestore每日配额的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!