how to stop and restart mongodb in linux code example
Example 1: mongo restart
sudo service mongod start
Example 2: how to stop mongodb server in ubuntu
sudo systemctl stop mongodb
# it will stop running mongodb server
sudo service mongod start
sudo systemctl stop mongodb
# it will stop running mongodb server