If you installed MongoDB Enterprise or MongoDB Community on Linux with a package manager, you can uninstall it through the package manager. To completely remove MongoDB, you must also remove the MongoDB applications, the configuration files, and any directories containing MongoDB data and logs.
Considerations
Warning
This process completely removes MongoDB, its configuration, and all databases. Because this process is not reversible, ensure that all of your configuration and data are backed up before proceeding.
Uninstall MongoDB
Select your distribution to view instructions for uninstalling MongoDB: