Next, you define the schema to store product information. The product model for this example is a print with name
, imagefile
, description
, price
, and instock
counters. Listing 28.3 shows the full definition of ProductSchema
.
20 var ProductSchema = new Schema({
21 name: String,
22 imagefile: String,
23 description: String,
24 price: Number,
25 instock: Number
26 });
27 mongoose.model('Product', ProductSchema);
3.138.69.163