Installation of MongoDB

Installation of MongoDB

Step 1: Update and upgrade your system by running
sudo pacman -Syu

Step 2: we must install the git and base-devel group packages on the system.run cmd
sudo pacman -S --needed base-devel git

NOTE : you need should have yay on your system to install MongoDB. To install yay run : 
git clone https://aur.archlinux.org/yay-git.git
cd yay-git
makepkg -sri
At last Verify the installation by running. yay --version

But if you have yay in your system then u may proceed to

Step 3: install MongoDB by running the following command and opt for the default package once the installation starts.
yay -S mongodb-bin

Step 4: Next, install MongoDB by running the following command and opt for the default package once the installation starts.
yay -S mongodb-bin
Now proceed with its installation process.
After installation is completed.

Step 5: Now, run the mongodb service by using systemctl command.
sudo systemctl start MongoDB
sudo systemctl status mongodb

Step 6: Once again use systemctl command to enable mongodb service. Now, mongodb will restart whenever your machine boots up.
sudo systemctl enable mongodb

Step 7: Test the connection status by running the mongo shell command
mongo --version OR mongod --version

if the version is showing then MongoDB is installed successfully

Now after installation of MongoDB u need to install its Compass GUI

Installation of MongoDB Compass

yay -S mongodb-compass

Now after the MongoDB compass installation you can search it on your screen and your are ready build your projects.

Uninstallation of MongoDB

To uninstall MongoDB and all of its config files run:
sudo pacman -Rns mongodb-bin

1 Like