Created
December 9, 2019 16:01
-
-
Save paulobunga/d5d8d64a17820edb28f85dc4a1e753e6 to your computer and use it in GitHub Desktop.
Product model
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mongoose = require('mongoose'); | |
const Schema = mongoose.Schema; | |
const ProductSchema = new Schema({ | |
name: { type: String, required: true }, | |
qty: { type: Number }, | |
cost_price: { type: Number }, | |
sale_price: { type: Number } | |
}, { | |
timestamps: true | |
}); | |
module.exports = mongoose.model('Product', ProductSchema); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment