Quick Answer
Index filters let you specify which indexes the planner can use for a given query shape, overriding the planner's automatic choice. Set with planCacheSetFilter. Useful when the planner consistently picks a suboptimal plan and query hints aren't practical. More persistent than hints (survive restarts in MongoDB 6+). Use sparingly - usually fixing the query or index design is better.
Answer
Index filters restrict query planner index usage, helping force specific indexes for performance tuning.
S
SugharaIQ Editorial Team
Verified Answer
This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.
MongoDB interview questions and answers for beginner, junior, mid-level, senior, and expert developers. Perfect for freshers and experienced candidates.