how to make mongodb run as a service linux code example
Example 1: how to stop mongodb server in ubuntu
sudo systemctl stop mongodb
# it will stop running mongodb server
Example 2: ubuntu start mongodb
sudo mongod --fork --config /etc/mongod.conf