To clear console in MongoDB, you can use any of the following two syntaxes.
The first syntax is as follows, which is the usage of keyboard shortcut −
Ctrl + L
After pressing the above key, you can clear console in MongoDB.
The second syntax is as follows −
To understand the above syntaxes, let us implement them one by one. Here is the snapshot of my console.
The first query is as follows to clear console in MongoDB −
The following is the output −
Look at the above sample output, the console has been cleared. Let us check the console once again.
The second query is as follows to clear console i.e. type “cls” −
After pressing enter key, the console will clear. The screenshot of the sample output is as follows −