Today’s topic was about databases and this starts with a conceptual aside. First of all a relational database are tables of data related to each other as the name suggests. By breaking apart each part of the data it is easier to call it without repeating. An example would be having a person object name and name:value pair of first and last name
SQL stands for sequence query language and is a language designed for managing data. MySQL is an open sourced SQL database which we installed from NPM. Then I required it into the app and put it in the middleware like so.
Before the issue with databases was the repetitiveness of data which is why they were set up in tables to save hard drive space. However, hard drive space is not much of an issue anymore.
Just like what I did with MySQL first thing I did with Mongoose was install it and require it to the file. As shown below.
After installing and requiring Mongoose the next step was to create a schema. A schema is where all of the data lives on mongoose. Schemas are similar to function constructors and also have methods like .save.