WEBVTT

1
00:01.220 --> 00:17.060
NestJS allows you to easily integrate with the ORM to work with the database and with NestJS.

2
00:17.090 --> 00:28.640
We have a many options available, and in this video, let me show you that, firstly go to the techniques

3
00:28.640 --> 00:30.620
and go to the database.

4
00:31.280 --> 00:35.930
Now right here you can see we have many more options.

5
00:39.440 --> 00:50.570
For example mikroORM, SQLite, Knex, TypeORM, Prisma right.

6
00:51.830 --> 00:58.040
And we also have a NoSQL like Mongo.

7
00:58.460 --> 01:03.750
And in this section I will show you how to work with Mongo database.

8
01:04.470 --> 01:09.630
So for that reason, firstly let me click into the Mongo right here.

9
01:09.720 --> 01:10.320
Okay.

10
01:10.350 --> 01:11.220
Inside the techniques

11
01:11.310 --> 01:12.330
Click on Mongo.

12
01:13.020 --> 01:15.600
And firstly, we will install the mongoose.

13
01:17.850 --> 01:22.530
And the NestJS Mongo to work with the NestJS

14
01:24.390 --> 01:34.980
Okay I will copy that and go to the project and paste that and while it's being install.

15
01:35.160 --> 01:42.720
I will go to the MongoDB to create the account.

16
01:55.050 --> 01:58.980
I will sign up with the account.

17
01:58.980 --> 01:58.990
How?

18
02:08.410 --> 02:08.500
Come.

19
02:14.170 --> 02:18.010
After that, we will go to the page like this

20
02:19.180 --> 02:23.950
And firstly, I will click on Create New Project right here.

21
02:28.480 --> 02:33.580
And I will name for Project post_nestjs

22
02:34.600 --> 02:36.430
Okay this is my project.

23
02:36.430 --> 02:41.110
And I will click on next and Create Project.

24
02:54.700 --> 02:59.400
And click on Create Cluster right here.

25
03:01.260 --> 03:09.000
Or You can click into the cluster and create that. I will choose the three option okay three option right here.

26
03:11.670 --> 03:12.600
And a name

27
03:12.630 --> 03:15.720
The name will be PostCluster.

28
03:16.320 --> 03:17.550
I will name like this.

29
03:17.910 --> 03:26.460
Then I will choose the provider and choose the region and click on Create Deployment.

30
03:28.890 --> 03:29.490
Right here.

31
03:35.700 --> 03:40.860
And we will have a create a database.

32
03:40.980 --> 03:44.670
So I will create a database like this.

33
03:44.730 --> 03:46.170
Username and password.

34
03:46.380 --> 03:46.920
Password.

35
03:46.920 --> 03:47.820
Make sure

36
03:48.090 --> 03:49.500
You remember that.

37
03:50.310 --> 03:50.850
Okay.

38
03:51.300 --> 03:52.710
Make sure you remember.

39
03:54.870 --> 04:04.240
I will use the same username and same password and I will click on create database user right

40
04:04.240 --> 04:04.600
here.

41
04:09.190 --> 04:11.710
And we have a two option methods.

42
04:11.710 --> 04:16.810
And we we will work with the MongoDB.

43
04:18.910 --> 04:19.960
And click on done.

44
04:20.740 --> 04:21.220
Okay.

45
04:21.850 --> 04:25.930
And we will wait to cluster create

46
04:27.550 --> 04:27.910
Okay.

47
04:27.940 --> 04:28.720
Let's wait that.

48
04:29.710 --> 04:39.340
And when we wait that, you can go to the security and click on the network access and we will edit.

49
04:39.580 --> 04:44.020
Click on edit and click on the Allow Access from anywhere.

50
04:44.230 --> 04:48.340
And it will change the IP address to zero zero.

51
04:48.370 --> 04:49.120
Right here.

52
04:50.320 --> 04:57.560
The reason we do that because, if you change the Network.

53
04:57.860 --> 05:04.010
Okay, you change the Wi-Fi on the network, it will create a different IP.

54
05:04.580 --> 05:09.440
And for that reason you will no longer access into the MongoDB anymore.

55
05:09.440 --> 05:12.800
So for that reason, we will accept it from anywhere.

56
05:17.270 --> 05:21.890
Okay and click on the cluster to see it created or not.

57
05:26.480 --> 05:27.020
Okay.

58
05:27.050 --> 05:28.400
Let wait that

59
05:28.550 --> 05:32.570
You can see, it take some time right?

60
05:33.410 --> 05:37.310
And let's see the project we already created.

61
05:38.000 --> 05:41.300
Sorry, we already installed the package right here.

62
05:44.240 --> 05:46.430
Right here and here.

63
05:46.460 --> 05:47.000
Right.

64
05:47.510 --> 05:52.640
And now let's pause the video right here and wait for cluster.

65
05:52.880 --> 05:53.540
Create

66
05:53.750 --> 05:56.180
And I will see you in the next one.