Details
Description
Hello team,
The below example is misleading, I have found out that this example is not working.
For example, the following db.setProfilingLevel() method sets for a mongod instance:
- the profiling level to 2,
- the filter of { op: "query", millis: { $gt: 2000 }}, which causes the profiler to only log query operations that took longer than 2 seconds.
db.setProfilingLevel( 2, { filter: { op: "query", millis: { $gt: 2000 } } } ) |
To me, the filter for Data Profiler works with db.setProfilingLevel( 1 ) only.
db.setProfilingLevel( 1, { filter: { op: "query", millis: { $gt: 2000 } } } ) |
Which makes sense with the below description
Level | Description |
---|---|
0 | The profiler is off and does not collect any data. This is the default profiler level. |
1 | The profiler collects data for operations that take longer than the value of slowms or that match a filter. When a filter is set:
|
2 | The profiler collects data for all operations. |
https://www.mongodb.com/docs/manual/tutorial/manage-the-database-profiler/#database-profiler
Can you please check this out and rectify the example?