concept schema level in category angular
appears as: schema level

This is an excerpt from Manning's book Getting MEAN with Mongo, Express, Angular, and Node.js 2ED.
As well as modeling data, Mongoose adds an entire layer of features on top of MongoDB that are useful for building web applications. Mongoose makes it easier to manage the connections to your MongoDB database and to save and read data. You’ll use all of these features later. Also later in the book, we’ll discuss how Mongoose enables you to add data validation at the schema level, making sure that you allow only valid data to be saved in the database.
At the schema level, using Mongoose, before the data is saved
Listing 7.24. Adding validation to reviews at the schema level
const reviewSchema = new mongoose.Schema({ author: { #1 type: String, #1 required: true #1 }, #1 rating: { #1 type: Number, #1 required: true, #1 min: 0, #1 max: 5 #1 }, #1 reviewText: { #1 type: String, #1 required: true #1 }, #1 createdOn: { #2 type: Date, #2 'default': Date.now #2 } #2 });