In this post, we will see how to install and configure MongoDB on Windows.
But first of all, what is MongoDB?
MongoDB is a cross-platform, document oriented database that provides, high performance, high availability, and easy scalability.
A MongoDB Database is formed of three main components:
DATABASE – the physical container for collections
COLLECTION – it is a group of MongoDB documents and we can consider it as a table of a RDBMS. A collection doesn’t enforce a schema and every documents of a collection can have different fields.
DOCUMENT – it is a set of key-value pairs. Documents have dynamic schema and it means means that documents in the same collection do not need to have the same set of fields or structure.
Why and When to Use MongoDB?
For all questions and information, we can read the official MongoDB web site: https://www.mongodb.com/why-use-mongodb
In order to install MongoDB on Windows, we go to https://www.mongodb.com and click on the “Try Free” button:
Then, we click on the “On-Premises” button:
Finally, we choice MongoDB Community Server, we select our Platform and then we click on the “Download” button:
After the download, we click on the downloaded file called mongodb-windows-x86_XX-X.X.X-signed, in order to start the installation:
If the installation went well, we should see the MondoDb services runs in our system:
The last thing to do, is to add in our Path Environment Variable, the path for the file mongo.exe (C:\Program Files\MongoDB\Server\4.4\bin), that it allow us to work with our MongoDB:
Now, with the command mongo we will connect a Mongo shell:
where, using the command show database, we can get the list of all databases in our MondoDB instance:
thanks now to learn something new!