Set the profiling level
MongoDBParametersCommand
db.setProfilingLevel(1, { slowms: 100 })What it does
Records slow queries (over 100 ms) in the system.profile collection (level 1).
When to use it
When you want to diagnose slow queries.
Caution
Level 2 records all operations and adds significant overhead; profiling data takes up disk space.