diff --git a/model/book.model.js b/model/book.model.js new file mode 100644 index 0000000000000000000000000000000000000000..16d2fb54145ae94d08763e554820b5ec926df602 --- /dev/null +++ b/model/book.model.js @@ -0,0 +1,17 @@ +const mongoose = require('mongoose'); + +const Schema = mongoose.Schema; + +const bookSchema = new Schema({ + _id : {type: String,required: true}, + book_name: { type: String,unique: true, required: true }, + author: { type: String, required: true }, + price: {type: Number, required: true}, +}, { + timestamps: true, +}); + + +const Book = mongoose.model('Book', bookSchema); + +module.exports = Book; \ No newline at end of file