In this park, we are going to create a model.
So first we are going to create a folder called Models.
And then inside of Hooda, we create a file called Items Thoughts.
And we are going to use the mongoose package, so we need to use Leapai it.
And then we need to get something from the mongoose copter, which is the skimmer, so we create a variable
called schema is equal to one goose schema and then we set that constant item schema is equal to a new
schema and their name is string.
So we set a type string and it is required.
So we said that we acquired it through and then the next property is the price.
And if you do not, we acquired these properties, you can just name it as price and then number, but
also want this and say we acquired properties.
So we said and we said the type is number and required is true.
And then we are going to enable the timestamp.
So we need to put another properties here because the timestamps we said to you, when you enable this
timestamped, the mongoose will at the create and update properties to your schema and by the force
to create, add and update ahead of time date.
So when you update the documents, the mongoose will automatically increments the update at at last.
And we are going to create a model based on this schema.
So we set a constant item is equal to one good thought model and then the Nemitz items and then we use
the schema of item schema and at last we will export that so that we can use it in elsewhere.
So we use for export use equal to item.
And this is a very important item because it will look at this name and popularizes and then look for
the collections inside a Mongo DB.
For example, if you as items, we will look for the collection items and if you name it as apples and
then it will find that the collections name as appose.
So this word is very important for finding the connections so we can get back to items.