Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumMongoDBTTL indexesSingle-choice MCQ

A TTL index is defined on a date field with `expireAfterSeconds: 3600`. A document is inserted whose indexed field is an ARRAY of multiple dates. How does the TTL background process decide when to delete it?

db.sessions.createIndex({ expiresAt: 1 }, { expireAfterSeconds: 3600 }) db.sessions.insertOne({ expiresAt: [ ISODate("2026-01-01"), ISODate("2026-06-01") ] })