O'Reilly logo

Hands-On Full Stack Web Development with Aurelia by Erikson Haziz Murrugarra Sifuentes, Diego Jose Arguelles Rojas

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Decoupling the Team Model

We have created a models folder in the root project directory. In this folder, we will create all the models for our application. Start creating the team.js file in the src/models folders:

$ touch src/models/team.js

Remember that we use the touch command to create a new file. Then, open this file, and from the src/config/mongoose-connection.js file, cut the following lines and copy them into the src/models/team.js file, as follows:

const mongoose = require('mongoose')const TeamSchema = new mongoose.Schema({    name: {      type: String,      min: 3,      max: 100,      required: true,      unique: true    },    ranking: {      type: Number,      min: 1    },    captain: {      type: String,      required: true    },    Trainer: {      type: String,      required: true    }, confederation: { ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required