- Reference >
mongoShell Methods >- Collection Methods >
- db.collection.getIndexStats()
db.collection.getIndexStats()¶
On this page
Definition¶
-
db.collection.getIndexStats(index)¶ Displays a human-readable summary of aggregated statistics about an index’s B-tree data structure. The information summarizes the output returned by the
indexStatscommand andindexStats()method. ThegetIndexStats()method displays the information on the screen and does not return an object.The
getIndexStats()method has the following form:Parameter Type Description indexdocument The index name. The
getIndexStats()method is available only when connected to amongodinstance that uses the--enableExperimentalIndexStatsCmdoption.To view index names for a collection, use the
getIndexes()method.Warning
Do not use
getIndexStats()orindexStatswith production deployments.
Example¶
The following command returns information for an index named
type_1_traits_1:
The command returns the following summary. For more information on the
B-tree statistics, see indexStats.