MongoDB 2.0.9 IndexStats

mongodb

I am trying to get the index usage statistics in a mongoDB 2.0.9.

I found a similar question in https://stackoverflow.com/questions/44813787/how-to-check-index-usage-in-mongodb but this only applies to versions 3.2 and up.

Any assistance will be very appreciated.

Best Answer

The $indexstats command was added for the MongoDB 3.2 server release in Dec 2015. Without server support for measuring or logging index use, I'm not aware of any obvious workaround short of modifying the 2.0.x server code and building a custom server.

MongoDB 2.0 is a relatively ancient server version: it was first released in Sept 2011 and reached End-of-Life in March 2013. I'd strongly recommend planning to upgrade to a modern & supported version of MongoDB (currently 3.4+, although 3.4 will reach EOL in Jan 2020). There are numerous essential bug fixes, stability, and security improvements since 2.0.