What is MongoDB in MEAN Stack
In our previous module, we had a closer look at the angular and node. Previously, we didn't stored any data on our server. We need to persist data on the server so that our users can load the data whenever they come back to our webpage, even if they come back to it from a different machine.
MongoDB is a type of NoSQL database that stores documents and collections. The documents are equivalent to records, and the collections are what we know as tables in SQL. So, MongoDB is a database that runs on a server. We store application data there like our users, products, and etc. The MongoDB enforces no data schema or relations. So, the individual records can be structured in the way we want.
MongoDB is easily connected to node and express, and that is something great about MongoDB. We can easily add it to a node express backend, not directly to angular.
Overall, MongoDB is a powerful database that we can easily integrate into our node express environment.
We will use MongoDB here because the MEAN Stack is really popular, but we could theoretically swap it for any other database, e.g., MySQL. Now the question is, why are we using MongoDB and what is the difference between MongoDB or NoSQL databases and SQL solutions like MYSQL?
Difference between NoSQL and SQL
Features of MongoDB
These are some of the following features which make important to use it as a database in MEAN Stack:
To learn more about MongoDB, go to the https://www.javatpoint.com/mongodb-tutorial link.
In the next section, we will learn how to set up the MongoDB for our application.