April 2020
Intermediate to advanced
716 pages
18h 55m
English
We will implement a Mongoose model to define a Shop model for storing the details of each shop. This model will be defined in server/models/shop.model.js, and the implementation will be similar to other Mongoose model implementations covered in previous chapters, like the Course model defined in Chapter 6, Building a Web-Based Classroom Application. The Shop schema in this model will have simple fields to store shop details, along with a logo image, and a reference to the user who owns the shop. The code blocks defining the shop fields are given in the following list with explanations:
name: { type: String, ...Read now
Unlock full access