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

dbStats

dbStats

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 “Database Statistics Reference” document for an overview of this output.