I have a shell script to do some mongo db actions:
e.g. mongo testdb --eval \"db.dropDatabase()\"
BUT, if the mongod server is not running, I get:>
If you have administrative rights, you could also do a sudo systemctl status mongod
which gives you lots of helpful additional information:
mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2019-03-14 09:26:53 UTC; 5 weeks 9 days ago
Docs: https://docs.mongodb.org/manual
Main PID: 420 (mongod)
CGroup: /system.slice/mongod.service
└─420 /usr/bin/mongod --config /etc/mongod.conf