We have reached the limit of the number of indexes allowed for a collection. We have a bunch of indexes that are used very little. It is difficult to track in code where the index was used. So is it possible to find the query which used the index? This way we can find the code and refactor it.
Asked
Active
Viewed 65 times
1
-
You can use `explain` method on queries to find indexes used on a query and `$indexStats` aggregation stage about index usage on a collection. – prasad_ Aug 03 '20 at 11:04
-
1I want the reverse of `explain`. I have the index, I need to find which query used it. IndexStats tells usage of the index and not the query using the index – suku Aug 04 '20 at 11:06