From 0728bd9b24ce18a3a4368ccd07212750b8a1ba83 Mon Sep 17 00:00:00 2001 From: Ashwanth K <cb.en.u4cse19305@cb.students.amrita.edu> Date: Sun, 27 Dec 2020 20:39:02 +0530 Subject: [PATCH] Upload New File --- model/book.model.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 model/book.model.js diff --git a/model/book.model.js b/model/book.model.js new file mode 100644 index 0000000..16d2fb5 --- /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 -- GitLab