Now that we have our schema, it is time to tell Mongoose that we want to use that Schema to create new objects in order to send them to MongoDB. To do this, we need to create a model by passing the schema already defined. Open the mongoose-connection.js file and add the following code:
...const Team = mongoose.model('team', TeamSchema)
Believe it or not, we just need this line to interface our schema to MongoDB. In this line, we tell Mongoose that we want to call our collection as team. The result of calling mongoose.model will be an object that is the model; we will use this object to create new instances. The Team object also contains built-in CRUD methods, so we will use them to create CRUD operations to the database.