start mongodb service at startup in rc.local code example
Example 1: start mongodb service ubuntu
sudo systemctl start mongod
sudo systemctl stop mongod
Example 2: how to start mongodb server in ubuntu
sudo systemctl start mongodb
# it will starts mongodb server