Get indexes usage for all collections of all databases of your MongoDB instance

One possible area of ​​improvement when you encounter bottlenecks when inserting or updating in MongoDB is to limit the number of indexes on your collections.

Even though indexes are good for queries against collections, they add an extra step when inserting or updating, which may take some time. Given this fact, it may be wise to delete unused indexes.

So, today, I’m going to give you a Mongo shell script that I use to get statistics on indexes usage for all collections on a MongoDB instance and to identify those that are not used.

Continue reading “Get indexes usage for all collections of all databases of your MongoDB instance”