Spaces:
Running
Running
| const mongoose = require('mongoose'); | |
| const productSchema = mongoose.Schema( | |
| { | |
| name: { type: String, required: true }, | |
| description: { type: String, required: true }, | |
| price: { type: Number, required: true }, | |
| category: { type: String, required: true }, // e.g. "Texnika", "Kiyim", "Aksessuar" | |
| imageUrl: { type: String, required: false }, | |
| sizes: { type: [String], default: [] } | |
| }, | |
| { | |
| timestamps: true, | |
| } | |
| ); | |
| const Product = mongoose.model('Product', productSchema); | |
| module.exports = Product; | |