- Reference >
- JavaScript Methods >
- db.stats()
db.stats()¶
-
db.
stats
(scale)¶ Parameters: - scale – Optional. Specifies the scale to deliver results. Unless specified, this command returns all data in bytes.
Returns: A document that contains statistics reflecting the database system’s state.
This function provides a wrapper around the database command “
dbStats
”. Thescale
option allows you to configure how themongo
shell scales the sizes of things in the output. For example, specify ascale
value of1024
to display kilobytes rather than bytes.See the “Database Statistics Reference” document for an overview of this output.
Note
The scale factor rounds values to whole numbers. This can produce unpredictable and unexpected results in some situations.