- 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”. Thescaleoption allows you to configure how themongoshell scales the sizes of things in the output. For example, specify ascalevalue of1024to 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.