How to completely uninstall mongoDB with all its instances, and re-install it.
I've tried this,
sudo service mongod stop
sudo apt-get purge mongodb-org*
sudo rm -r /var/log/mongodb
sudo apt-get autoclean
sudo apt-get autoremove
sudo apt-get purge mongodb-org*
But its giving the below error :
sudo rm -r /var/log/mongodb its giving error :rm: cannot remove '/var/log/mongodb': No such file or directory
sudo rm -r /var/lib/mongodb its giving error :rm: cannot remove '/var/lib/mongodb': No such file or directory
Now still, it's not removed completely.
reema@reema-s ~> mongo MongoDB shell version v4.0.11 connecting to: mongodb://127.0.0.1:27017/?gssapiServiceName=mongodb 2019-07-25T15:45:34.860+0530 E QUERY [js] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused : connect@src/mongo/shell/mongo.js:344:17 @(connect):2:6 exception: connect failed reema@reema-s ~>