forked from AdithyakrishnaV/BookAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a8e9eff
commit 40e788e
Showing
3 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const mongoose = require("mongoose"); | ||
|
||
//Creating an author schema | ||
const AuthorSchema = mongoose.Schema({ | ||
id: Number, | ||
name: String, | ||
books:[String] | ||
}); | ||
|
||
// Creating a model | ||
const AuthorModel = mongoose.model(AuthorSchema); | ||
|
||
module.exports = AuthorModel; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const mongoose = require("mongoose"); | ||
|
||
//Creating a book schema | ||
const BookSchema = mongoose.Schema({ | ||
ISBN: String, | ||
title: String, | ||
pubDate: String, | ||
language: String, | ||
numPage: Number, | ||
authors: [Number], | ||
publication: [Number], | ||
category: [String], | ||
}); | ||
|
||
// Create a model | ||
const BookModel = mongoose.model(BookSchema); | ||
|
||
module.exports = BookModel; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const mongoose = require("mongoose"); | ||
|
||
// Publication schema | ||
const PublicationSchema = mongoose.Schema({ | ||
id: Number, | ||
name: String, | ||
books:[String] | ||
}); | ||
|
||
// Creating a model | ||
const PublicationModel = mongoose.model(PublicationSchema); | ||
|
||
module.exports = PublicationModel; |