Complete the code to enable the profiler for slow queries in MongoDB.
db.setProfilingLevel([1])Setting profiling level to 1 enables profiling for slow operations only.
Complete the code to set the slow operation threshold to 100 milliseconds.
db.setProfilingLevel(1, { slowms: [1] })
Setting slowms to 100 means queries slower than 100 milliseconds are profiled.
Fix the error in the command to retrieve slow queries from the system profiler collection.
db.system.profile.find({ [1]: { $gt: 100 } })The field 'millis' stores the query duration in milliseconds in the profiler collection.
Fill both blanks to query slow operations longer than 200 ms and sort by duration descending.
db.system.profile.find({ [1]: { $gt: 200 } }).sort({ [2]: -1 })Use 'millis' to filter and sort by query duration in milliseconds.
Fill all three blanks to enable profiling for slow queries over 150 ms and retrieve them sorted by duration.
db.setProfilingLevel([1], { slowms: [2] }); db.system.profile.find({ [3]: { $gt: 150 } }).sort({ [3]: -1 })
Profiling level 1 enables slow query profiling with slowms 150 ms. Use 'millis' to filter and sort.