Currently, NoSQL Database managers are being widely used by developers. Since it has many advantages and their projects are the most open source. And MongoDB is one of the most popular managers. So, this article is about how to install MongoDB in Fedora 29.
MongoDB allows your teams to easily organize, use and enrich data – in real time, anywhere. MongoDB is a NoSQL and document-oriented database manager. In short, instead of saving the data in the record as the SQL database, it saves them in documents with BSON format which is a binary representation of JSON.
In the world of unrelated SQL database MongoDB is perhaps the most popular, however, it can be used by very different applications that require a semi-structured data collection. On the other hand, its use in transactional systems is not recommended as MongoDB does not support transactions.
That’s why I’m going to teach you how to install MongoDB on the latest stable version of Fedora, Fedora 29.
Install MongoDB on Fedora 29
There are several ways to install MongoDB. First, you can download the packages individually and then install them from the console. It is not complicated, but there is a problem, when there is an update of the program, you will have to repeat the process.
On the other hand, you can add the MongoDB repository and install it via DNF. The main advantage of this method is that when there is an update, it will be downloaded along with the system updates.
So, I will choose the second option.
First, create a file to add the repository:
:~$ sudo nano /etc/yum.repos.d/mongodb.repo
And add the following:
[Mongodb] name=MongoDB Repository baseurl=https://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/4.0/x86_64/ gpgcheck=1 enabled=1 gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc
Press CTRL + X and say yes to save the file.
With this the MongoDB repository is added, now you can install it without problems.
:~$ sudo dnf install mongodb-org
Now, it is installed. However, it is a good idea to enable the service. In addition, you have to start the service too.
:~$ sudo systemctl enable mongod :~$ sudo systemctl start mongod
Finally, check the service status:
:~$ sudo systemctl status mongod
Checking the installation
To test the installation, check the installed version of MongoDB.
:~$ mongod -version
Now access to the console:
:~$ mongo use mydb;
As you can see, MongoDB is correctly installed.
MongoDB is a solution that is increasingly being taken into account by many developers worldwide. Its installation in Fedora 29 and Fedora 28 is relatively simple.
Please share this article with your friends.