azure - 了解 DocumentDB 响应 header 中的 x-ms-resource-usage

标签 azure azure-cosmosdb nosql

在通过 Id 执行简单的 Get 操作时,返回单个文档(而不是包含一个文档的数组),我得到以下 x-ms-resource-usage:

x-ms-resource-usage:documentSize:0;documentsSize:288;collectionSize=307;

问题:

  • 为什么documentSize为0?
  • 计量单位是什么?字节?
  • documentSizedocumentsSize 之间有什么区别?请注意,查询仅返回一份文档。
  • collectionSize 是什么?这是集合中文档的总数吗?
  • x-ms-resource-usagex-ms-resource-quota 之间有什么区别?

最佳答案

我相当确定数字如下,全部以 KB 为单位:

  • documentSize:文档的大小
  • documentsSize:集合中所有文档的总大小
  • collectionSize:集合中所有文档的总大小,以及索引等开销

x-ms-resource-usage 是关于集合中消耗的资源,而 x-ms-resource-quota 将为您提供限制。因此,使用配额时,您会看到 documentsSizecollectionSize 均设置为 10485760 之类的值,即 10GB (10,485,760 MB)。

关于azure - 了解 DocumentDB 响应 header 中的 x-ms-resource-usage,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35274760/

相关文章:

python - Azure Linux Web 应用程序(startup.sh : not found)

javascript - 使用 CSV 批量上传到 Azure 存储

python - 如何使用 Azure Python SDK 或 Azure Cli 管理 Azure 备份

MongoDB最佳实践: nesting

python - Azure 函数从输入流保存临时 pdf 文件已损坏

c# - 如何查询特定类型,然后获取底层文档

linq - 使用 Id 以外的属性查询 DocumentDB

azure - 如何在 Cosmos DB 中对两个容器进行内连接

angularjs - Firebase/AngularFire 中的数据建模最佳实践

node.js - 什么是作业队列的好用例