Shing Lyu's Random Tech Facts

This is a micro-blog where I write one-liners about random tech stuff I learned.

Check MongoDB index usage statistics

Run this command to get the usage of each index:

db.<collection>.aggregate( [ { $indexStats: { } } ] )

This is useful for figuring out which index is underutilized. You can find an example output in the documentation.