C100DEV Indexing Practice Question
A collection 'logs' has a TTL index on the 'createdAt' field with expireAfterSeconds set to 3600. A developer notices that some documents older than one hour are still present in the collection. Which explanation is most likely?
⚠ Common exam trap
The trap here is assuming that TTL deletion is instantaneous or that other indexes can block it.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The TTL monitor runs every 60 seconds and may have not yet processed those documents, so they can remain for a short period beyond the expiration time.
The TTL monitor is a background process that runs every 60 seconds to delete expired documents. Due to this interval, documents can remain for a short time after their expiration time. This is the most likely reason for seeing documents older than one hour still present in the collection.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The TTL index only deletes documents when they are queried, so unqueried documents remain indefinitely.
Why it's wrong here
This is false because TTL deletion is not triggered by queries. The TTL monitor proactively scans the index and removes expired documents in the background, regardless of whether they are queried. Documents are not left indefinitely; they will be removed once the TTL monitor processes them, within the typical delay.
- ✗
The TTL index only deletes documents when the MongoDB server is restarted.
Why it's wrong here
This is incorrect because the TTL monitor runs continuously in the background, typically every 60 seconds. It does not require a server restart to delete expired documents. The deletion process is automatic and periodic, so documents should be removed within a short time after expiration, not only on restart.
- ✗
The TTL index does not delete documents if the collection has a compound index that includes the createdAt field.
Why it's wrong here
This is wrong because the presence of other indexes, including compound indexes that include the TTL field, does not prevent the TTL index from deleting documents. The TTL index operates independently based on its own definition. Other indexes do not interfere with the TTL deletion process, so this is not a valid reason for documents remaining.
- ✓
The TTL monitor runs every 60 seconds and may have not yet processed those documents, so they can remain for a short period beyond the expiration time.
Why this is correct
This is correct because the TTL background thread runs approximately every 60 seconds. Documents are not deleted exactly at the expiration second; there can be a delay of up to a minute or more. Therefore, documents older than one hour might still be present if the TTL monitor has not run yet since they expired. This is expected behavior.
About these practice questions
Courseiva writes every C100DEV question from scratch — 259 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official MongoDB exam blueprint
This C100DEV practice question is part of Courseiva's free MongoDB certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the C100DEV exam.