Skip to main content
InterviewHubPRO
Section Overview
Q46

Question 46 of 50

Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)

92%
MongoDB & NoSQL (50 Qs)•Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)

TTL (Time-To-Live) and Partial Indexes in MongoDB.

senior LevelMost AskedDatabases & SQL

In Simple Words:

  • TTL Index: Automatically deletes documents after a specified number of seconds (expireAfterSeconds: 3600). Ideal for temporary OTP verification codes, shopping cart sessions, and log retention.
  • Partial Index: Indexes only documents matching a filter expression (partialFilterExpression: { active: true }), reducing index memory size.