发布于 2015-09-14 15:08:06 | 185 次阅读 | 评论: 0 | 来源: 网络整理
The dbStats command returns storage statistics for a given database. The command takes the following syntax:
{ dbStats: 1, scale: 1 }
The value of the argument (e.g. 1 above) to dbStats does not affect the output of the command. The scale option allows you to specify how to scale byte values. For example, a scale value of 1024 will display the results in kilobytes rather than in bytes.
The time required to run the command depends on the total size of the database. Because the command has to touch all data files, the command may take several seconds to run.
In the mongo shell, the db.stats() function provides a wrapper around this functionality. See the “数据库统计参考” document for an overview of this output.