Skip to content

Commit

Permalink
Created Book model with mongoose
Browse files Browse the repository at this point in the history
  • Loading branch information
IsmailAkram committed Dec 1, 2023
1 parent 8e32f22 commit 0f1b193
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions backend/models/bookModels.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import mongoose from "mongoose";

const bookSchema = new mongoose.Schema(
{
title: {
type: String,
required: true,
},
author: {
type: String,
required: true,
},
publishYear: {
type: Number,
required: true,
},
},
{
timestamps: true,
}
);

export const Book = mongoose.model("Book", bookSchema);

1 comment on commit 0f1b193

@IsmailAkram
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.