diff --git a/author.js b/author.js index 2bb5e78..0434861 100644 --- a/author.js +++ b/author.js @@ -8,6 +8,6 @@ const AuthorSchema = mongoose.Schema({ }); // Creating a model -const AuthorModel = mongoose.model(AuthorSchema); +const AuthorModel = mongoose.model("authors", AuthorSchema); module.exports = AuthorModel; \ No newline at end of file diff --git a/book.js b/book.js index 4f418af..f067ef2 100644 --- a/book.js +++ b/book.js @@ -13,6 +13,6 @@ const BookSchema = mongoose.Schema({ }); // Create a model -const BookModel = mongoose.model(BookSchema); +const BookModel = mongoose.model("books", BookSchema); module.exports = BookModel; \ No newline at end of file diff --git a/index.js b/index.js index f5f8831..26387c7 100644 --- a/index.js +++ b/index.js @@ -8,6 +8,11 @@ const mongoose = require("mongoose"); //Database const database = require("./database"); +//Models +const BookModels = require("./book"); +const AuthorModels = require("./author"); +const PublicationModels = require("./publication") + // Initialization const booky = express(); diff --git a/publication.js b/publication.js index 14a2250..d7e8387 100644 --- a/publication.js +++ b/publication.js @@ -8,6 +8,6 @@ const PublicationSchema = mongoose.Schema({ }); // Creating a model -const PublicationModel = mongoose.model(PublicationSchema); +const PublicationModel = mongoose.model("publications", PublicationSchema); module.exports = PublicationModel; \ No newline at end of file