If you encounter some problems with your MongoDB server and try to reinstall it or just want to uninstall it. The following will cover how to purge Mongo completely (including dependencies, configuration file, logs and database storage) on Debian/Ubuntu-based Linux distros (e.g. Linux Mint, Pop!OS, Elementary OS).
MongoDB is one of the most popular NoSQL databases around. In this tutorial we'll be covering how to install the latest version of MongoDB Community Server from its official repository, and the following steps work for Ubuntu 20.04 LTS (Focal), 18.04 LTS (Bionic) and 16.04 LTS (Xenial).