how to start mongo db when I restart the server code example
Example 1: mongo restart
sudo service mongod start
Example 2: how to restart mongodb server in ubuntu
sudo systemctl restart mongodb
# it will restarts running mongodb server
sudo service mongod start
sudo systemctl restart mongodb
# it will restarts running mongodb server