翻译或纠错本页面
- Reference >
- mongo Shell Methods >
- 数据库相关方法 >
- db.stats()
db.stats()¶
Description¶
- db.stats(scale)¶
Returns statistics that reflect the use state of a single database.
The db.stats() method has the following parameter:
Parameter Type Description scale number Optional. The scale at which to deliver results. Unless specified, this command returns all data in bytes. 返回: A document with statistics reflecting the database system’s state. For an explanation of the output, see dbStats. The db.stats() method is a wrapper around the dbStats database command.
Example¶
The following example converts the returned values to kilobytes:
db.stats(1024)
注解
The scale factor rounds values to whole numbers. This can produce unpredictable and unexpected results in some situations.