- Reference >
- Legacy
mongo
Shell > - Native Methods in the Legacy Shell >
- setVerboseShell()
setVerboseShell()¶
On this page
Note
The native method listed here is for the legacy mongo
shell.
To use native methods in mongosh
, see
Native Methods in mongosh.
-
setVerboseShell
()¶ The
setVerboseShell()
method configuresmongosh
to print the duration of each operation.setVerboseShell()
has the form:setVerboseShell()
takes one boolean parameter. Specifytrue
or leave the parameter blank to activate the verbose shell. Specifyfalse
to deactivate.
Example¶
The following example demonstrates the behavior of the verbose shell:
From
mongosh
, set verbose shell totrue
:With verbose shell set to
true
, rundb.collection.aggregate()
:In addition to returning the results of the operation,
mongosh
now displays information about the duration of the operation: