Casy Casy - 1 month ago 13x
Bash Question

How to hide output of mongo terminal (Node.Js)

I am working with MongoDB in a Node server.

While my program is running i get a lot of output in the shell, like querys and other information. If i am right that is a lot of work more for the process, so i want to hide all kind of output.

I try runing the comand with the parameter --quiet

mongod --quiet

So i assume that i miss a configuration in the mongo driver of node.


  • MongoDB Version: 3.2.9

  • Node Version:v6.4.0


mongod documentation states:


Runs the mongod in a quiet mode that attempts to limit the amount of output.

This option suppresses:

  • output from database commands
  • replication activity
  • connection accepted events connection closed events

So still some output emerges from the process. To prevent this and hide ALL the output, both stdout and stderr, you need to say either of these equivalent commands:

process &>/dev/null
process >/dev/null 2>&1

In your case:

mongod &>/dev/null
mongod >/dev/null 2>&1

See What is /dev/null 2>&1? for some explanations on how this works.