how to check mongodb is running code example
Example 1: how to check mongodb status in ubuntu
sudo systemctl status mongodb
Example 2: mongodb get status
db.runCommand( { serverStatus: 1 } )
sudo systemctl status mongodb
db.runCommand( { serverStatus: 1 } )