In this hour, we are going to talk about the mongoose and we were going to use the mongoose, but what
is Mongoose?
Mongoose provide a straightforward schema based solution to the models of applications.
And Bongo is a Jimenez and Mongoose schema is a document data structure that is enforced.
We had an application data, their schema pairwise, what properties it should have and types of properties.
In our case, we are working with items.
So we have a schema for an item that have two properties and one is the name and the other is the price.
Models are the fancy constructor come apart from the schema definitions and instead of a model is called
a documents and models are responsible for creating and reading documents from the underlying Mongo
DB database.
So in this documentation, you can see we can use the model to construct the documents by using the
model box safe.
And we can also do some search, for example, by using the fight or flight by IP.
We can also delete a document and of course, we can also update the document and the back to our project.
We already have the link of the Mongo DB and first of all, we have to install the mongoose.
So we have to use NPM install both.
First, we are going to impose the mongoose by using the constant mongoose is going to require mongoose
and then we type Mongoose thought on that, the Mongo DB.
And since this is a MySpace and so we can use then and every little dialogue connected.
And then we used to catch error and also thought Laub error.
Now we can go to the terminal and start the server again by using the phone app.
Now, you can see there are some warnings here and we also have to connect to this.
So actually we can connect to the database already, but it is better to costis options to stop the
warning.
So we paste it to our mongoose stock on that.
And we also copied this one.
And here, so we save it and now you can see the Collinet and we don't want to listen to requests until
the conversion is complete.
So it is also better to take this and pass it inside the brocke.