remove and install mongodb ubuntu code example
Example 1: uninstall mongodb ubuntu
sudo apt-get purge mongodb-org*
Example 2: uninstall mongodb ubuntu
sudo rm -r /var/log/mongodb
sudo rm -r /var/lib/mongodb
Example 3: start mongodb service ubuntu
sudo systemctl start mongod
sudo systemctl stop mongod