You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
401 B
JavaScript
14 lines
401 B
JavaScript
1 year ago
|
const mongoose = require('mongoose');
|
||
|
|
||
|
const productSchema = new mongoose.Schema({
|
||
|
name: { type: String, required: true },
|
||
|
description: { type: String, required: true },
|
||
|
price: { type: Number, required: true },
|
||
|
isActive: { type: Boolean, default: true },
|
||
|
createdOn: { type: Date, default: Date.now },
|
||
|
});
|
||
|
|
||
|
const Product = mongoose.model('Product', productSchema);
|
||
|
|
||
|
module.exports = Product;
|