Created
July 3, 2022 00:09
-
-
Save genki/f5fbcd71ea523f053c6e8357c67a496a to your computer and use it in GitHub Desktop.
Find unused indexes out of mongodb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.<collections>.aggregate({$indexStats:{}})._batch.reduce((h,i) => {h[i.spec.name] = i.accesses.ops; return h}, {}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment