- Reference >
- Database Commands >
- dbStats
dbStats¶
-
dbStats¶ The
dbStatscommand returns storage statistics for a given database. The command takes the following syntax:The value of the argument (e.g.
1above) todbStatsdoes not affect the output of the command. Thescaleoption allows you to specify how to scale byte values. For example, ascalevalue of1024will 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
mongoshell, thedb.stats()function provides a wrapper around this functionality. See the “Database Statistics Reference” document for an overview of this output.