@@ -7,7 +7,7 @@ db.setProfilingLevel()
77.. contents:: On this page
88 :local:
99 :backlinks: none
10- :depth: 1
10+ :depth: 2
1111 :class: singlecol
1212
1313.. |binary| replace:: :binary:`~bin.mongod` or :binary:`~bin.mongos`
@@ -356,10 +356,7 @@ The following example sets for a :binary:`~bin.mongod` instance:
356356
357357 db.setProfilingLevel(1, { slowms: 20, sampleRate: 0.42 })
358358
359- The method returns a document with the **previous** values for the
360- settings.
361-
362- To view the current profiling level, see :method:`db.getProfilingStatus()`.
359+ .. include:: /includes/reference/return-set-profile.rst
363360
364361Disable Profiler and Set Slow Operation Threshold and Sample Rate
365362~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -379,10 +376,7 @@ The following example sets for a :binary:`~bin.mongod` or
379376
380377 db.setProfilingLevel(0, { slowms: 20, sampleRate: 0.42 })
381378
382- The method returns a document with the **previous** values for the
383- settings.
384-
385- To view the current profiling level, see :method:`db.getProfilingStatus()`.
379+ .. include:: /includes/reference/return-set-profile.rst
386380
387381.. _profiler-filter-example:
388382
@@ -403,7 +397,17 @@ The following example sets for a :binary:`~bin.mongod` instance:
403397
404398 db.setProfilingLevel( 1, { filter: { op: "query", millis: { $gt: 2000 } } } )
405399
406- The method returns a document with the **previous** values for the
407- settings.
400+ .. include:: /includes/reference/return-set-profile.rst
401+
402+ Unset a Filter
403+ ~~~~~~~~~~~~~~
404+
405+ To clear a profile filter, run ``db.setProfilingLevel()`` with the
406+ ``filter: "unset"`` option.
407+
408+ .. code-block:: javascript
409+
410+ db.setProfilingLevel( 1, { filter: "unset" } )
411+
412+ .. include:: /includes/reference/return-set-profile.rst
408413
409- To view the current profiling level, see :method:`db.getProfilingStatus()`.
0 commit comments