统计存储在Firebase Storage中的文件数量会计为存储操作吗?

huangapple go评论51阅读模式
英文:

Counting the number of files stored in Firebase Storage will count as a Storage Operation?

问题

我想知道以下代码片段是否会被视为 Firebase 存储操作,可能会影响有关 FireBase Pricing 计划的费用?

Future<void> countFiles() async {
  // 创建引用
  var storageReference = FirebaseStorage.instance.ref().child("<directory-name>");

  // 计算文件数量
  var fileList = await storageReference.listAll();
  setState(() {
    _fileCount = fileList.items.length;
  });
}

[1]: https://firebase.google.com/pricing
英文:

I'm wondering if the following code snippet will count as a Firebase Storage operation which could affect the costs regarding the FireBase Pricing plan?

Future&lt;void&gt; countFiles() async {
// Create a reference
var storageReference = FirebaseStorage.instance.ref().child(&quot;&lt;directory-name&gt;&quot;);

// Count the amount of files
var fileList = await storageReference.listAll();
setState(() {
  _fileCount = fileList.items.length;
});

答案1

得分: 1

是的,列出对象是一个需要计费的操作。您可以参考Google Cloud文档了解以下详细信息:

当操作应用于一个存储桶,例如列出存储桶中的对象时,该存储桶设置的默认存储类确定操作的费用。

英文:

Yes, listing objects is a billable operation. You will want to consult the Google Cloud documentation for details that:

> When an operation applies to a bucket, such as listing the objects in a bucket, the default storage class set for that bucket determines the operation cost.

huangapple
  • 本文由 发表于 2023年2月10日 06:31:45
  • 转载请务必保留本文链接:https://go.coder-hub.com/75405124.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定