MongoDB: db.collection.totalIndexSize() method
db.collection.totalIndexSize
The db.collection.totalIndexSize() method is used to reports the total size used by the indexes on a collection.
Syntax:
db.collection.totalIndexSize()
Sample document in the restaurants collection:
Example: MongoDB: db.collection.totalIndexSize() method
Following example describe the total index size of the collection restaurants.
Output:
> db.restaurants.totalIndexSize(); 833952
Retrieve the restaurants data from here
Previous:
db.collection.totalSize() method
Next:
db.collection.update() method