Navigation
This version of the documentation is archived and no longer supported.

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”. The scale option allows you to configure how the mongo shell scales the sizes of things in the output. For example, specify a scale value of 1024 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.