Skip to main content

Mongo Models

A brief look at how the data is modeled in this app.

Entities#

Book#

FieldType
nameString
genreString
authorIdString

Author#

FieldType
nameString
ageNumber

You can find these models here. This is an example on how it looks like:

const Schema = mongoose.Schema;
const bookSchema = new Schema({
name: String,
genre: String,
authorId: String
});

For more information on how to set up models with MongoDB check their official docs