Content
This deals with storage and persistant data using Mongoose as a interface to store data in the MongoDB object database. We also deal with Sessions and Flash messages in the website.
This is around the M in MVC, the Model.
Tuesday Zoom with examples
Mikael shows how to get going with Express.js and persistant data and storage.
The recorded videos are found in this playlist on YouTube.
Presentations
Review this HTML presentation of Persistent Data and Storage).
View it as a lecture in swedish or english.
Swedish with Mats L (Spring 2020):
English with Johan L and Mats L (Autumn 2019). The first video deals with "DB, MongoDB, Mongoose" and the second video deals with "Sessions and Flash Messages".
Demo example
Here is a repo with the demonstration code on how to get going with mongoose.
Review the 18 minute video on how to store structures in MongoDB.
Read & Study
Read and study the following.
-
Check out the "MDN: Express web framework (Node.js/JavaScript)" with different chapters on how to work with Node.js and Express to build a website. In particular, the following chapter might be extra helpful.
-
As a quick start for NPM package: Mongoose.
-
As a reference, Mongoose, read the docs.
- As a reference, the MongoDB Documentation.