/
crowleed
/
api
Обзор
Документация
Войти
/
crowleed
/
api
Код
Запросы
0
Задачи
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
models/product.model.js
35 строк
527 B
Andy Carter
Initial commit
30 июл 2024, 13:00
30 июл 2024, 13:00
664408a
Код
Авторство
О чём код?
const mongoose = require("mongoose"); const ProductSchema = mongoose.Schema( { name: { type: String, required: [true, "Please enter product name"], }, quantity: { type: Number, required: true, default: 0, }, price: { type: Number, required: true, default: 0, }, image: { type: String, required: false, }, }, { timestamps: true, } ); const Product = mongoose.model("Product", ProductSchema); module.exports = Product;