Skip to content

Instantly share code, notes, and snippets.

@paulobunga
Created December 9, 2019 16:01
Show Gist options
  • Save paulobunga/d5d8d64a17820edb28f85dc4a1e753e6 to your computer and use it in GitHub Desktop.
Save paulobunga/d5d8d64a17820edb28f85dc4a1e753e6 to your computer and use it in GitHub Desktop.
Product model
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