NestJS allows you to easily integrate with the ORM to work with the database and with NestJS.
We have a many options available, and in this video, let me show you that, firstly go to the techniques
and go to the database.
Now right here you can see we have many more options.
For example mikroORM, SQLite, Knex, TypeORM, Prisma right.
And we also have a NoSQL like Mongo.
And in this section I will show you how to work with Mongo database.
So for that reason, firstly let me click into the Mongo right here.
Okay.
Inside the techniques
Click on Mongo.
And firstly, we will install the mongoose.
And the NestJS Mongo to work with the NestJS
Okay I will copy that and go to the project and paste that and while it's being install.
I will go to the MongoDB to create the account.
I will sign up with the account.
How?
Come.
After that, we will go to the page like this
And firstly, I will click on Create New Project right here.
And I will name for Project post_nestjs
Okay this is my project.
And I will click on next and Create Project.
And click on Create Cluster right here.
Or You can click into the cluster and create that. I will choose the three option okay three option right here.
And a name
The name will be PostCluster.
I will name like this.
Then I will choose the provider and choose the region and click on Create Deployment.
Right here.
And we will have a create a database.
So I will create a database like this.
Username and password.
Password.
Make sure
You remember that.
Okay.
Make sure you remember.
I will use the same username and same password and I will click on create database user right
here.
And we have a two option methods.
And we we will work with the MongoDB.
And click on done.
Okay.
And we will wait to cluster create
Okay.
Let's wait that.
And when we wait that, you can go to the security and click on the network access and we will edit.
Click on edit and click on the Allow Access from anywhere.
And it will change the IP address to zero zero.
Right here.
The reason we do that because, if you change the Network.
Okay, you change the Wi-Fi on the network, it will create a different IP.
And for that reason you will no longer access into the MongoDB anymore.
So for that reason, we will accept it from anywhere.
Okay and click on the cluster to see it created or not.
Okay.
Let wait that
You can see, it take some time right?
And let's see the project we already created.
Sorry, we already installed the package right here.
Right here and here.
Right.
And now let's pause the video right here and wait for cluster.
Create
And I will see you in the next one.