- Reference >
mongo
Shell 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
indexStats
command 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 index
document The index name. The
getIndexStats()
method is available only when connected to amongod
instance that uses the--enableExperimentalIndexStatsCmd
option.To view index names for a collection, use the
getIndexes()
method.Warning
Do not use
getIndexStats()
orindexStats
with 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
.