对于 AI 代理:可在 https://www.mongodb.com/zh-cn/docs/llms.txt 获取文档索引—通过在任何 URL 路径后添加 .md 可获取所有页面的 Markdown 版本。
See how MongoDB 9.0 delivers up to 2x higher throughput.
MongoDB Branding Shape
Register now >
Docs 菜单

db.printCollectionStats()(mongosh方法)

db.printCollectionStats()

提供db.collection.stats()方法的包装器。 返回由三个连字符分隔的每个collection的统计信息。

注意

在 mongosh 中运行的 db.printCollectionStats() 方法不会返回 JSON。手动检查时使用 db.printCollectionStats(),脚本中使用 db.collection.stats()。

此方法可用于以下环境中托管的部署:

  • MongoDB Atlas:用于云中 MongoDB 部署的完全托管服务

注意

所有 MongoDB Atlas 集群都支持此命令。有关 Atlas 对所有命令的支持的信息,请参阅不支持的命令。

给本页内容打分

在此页面上