C100DBA Server Administration Practice Question
A developer reports slow queries on a specific collection. You decide to enable the database profiler to capture only queries taking longer than 200ms. Which command configuration achieves this?
⚠ Common exam trap
Candidates often select the wrong profiling level, confusing level 2 (which captures everything and causes significant performance degradation) with level 1 (the appropriate level for capturing slow queries only).
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
✓
db.setProfilingLevel(1, { slowms: 200 })
The database profiler is an essential administrative tool for diagnosing performance issues. Profiling level 1 is used to capture 'slow' operations without the overhead of capturing every single request (level 2). Setting the 'slowms' threshold to 200 allows the DBA to filter out expected noise and focus on the problematic operations.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
db.setProfilingLevel(1, { slowms: 200 })
Why this is correct
Profiling level 1 instructs MongoDB to log operations that exceed the specified 'slowms' threshold. Setting this to 200 ensures that only queries slower than 200 milliseconds are recorded in the 'system.profile' collection, providing a targeted dataset for performance tuning without overwhelming the server with logging overhead.
- ✗
db.setProfilingLevel(2, { slowms: 200 })
Why it's wrong here
Level 2 profiling captures all operations regardless of their duration. While the 'slowms' parameter can still be passed, it does not act as a filter for level 2; instead, all queries will be logged. This can cause significant performance impact on a production server and fill up the profile collection very quickly.
- ✗
mongod --profile 200 --slowms 1
Why it's wrong here
The flags provided in this option are syntactically incorrect for the mongod binary. The '--profile' flag expects an integer level (0, 1, or 2), not a millisecond threshold. Furthermore, setting 'slowms' to 1 would log almost every operation, which is the opposite of the goal to capture only queries over 200ms.
- ✗
db.adminCommand({ profile: 0, slowms: 200 })
Why it's wrong here
Setting the profiling level to 0 explicitly disables the profiler. Even if a 'slowms' threshold is provided, no data will be captured or written to the 'system.profile' collection. This configuration would result in the DBA receiving no diagnostic information about the slow queries reported by the developer.
About these practice questions
This C100DBA question is part of Courseiva's 222-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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 C100DBA 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 C100DBA exam.