Skip to content

Commit

Permalink
fix model document issue
Browse files Browse the repository at this point in the history
  • Loading branch information
AdithyakrishnaV committed Jul 1, 2021
1 parent 40e788e commit 09f4109
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion author.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
2 changes: 1 addition & 1 deletion book.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion publication.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit 09f4109

Please sign in to comment.