OPTIONS
翻译或纠错本页面

db.collection.stats()

Definition

db.collection.stats(scale)

Returns statistics about the collection. The method includes the following parameter:

Parameter Type Description
scale number Optional. The scale used in the output to display the sizes of items. By default, output displays sizes in bytes. To display kilobytes rather than bytes, specify a scale value of 1024.
返回:A document containing statistics that reflecting the state of the specified collection.

The stats() method provides a wrapper around the database command collStats.

Example

The following operation returns stats on the people collection:

db.people.stats()

参见

collStats for an overview of the output of this command.