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
402 B
JavaScript

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: false },
createdOn: { type: Date, default: Date.now },
});
const Product = mongoose.model('Product', productSchema);
module.exports = Product;