WEBVTT

00:00.210 --> 00:06.770
Any big application that is built up is always being built up by having all the tools locally installed.

00:06.780 --> 00:11.310
But let's just say for some reason you also want to utilize some of the features that is provided by

00:11.310 --> 00:13.380
the online version of MongoDB.

00:13.410 --> 00:14.940
That is also possible.

00:14.970 --> 00:19.080
Again, I would recommend that you please go ahead and install MongoDB locally.

00:19.080 --> 00:22.890
That will give you so much of advantage rather than these online services.

00:22.890 --> 00:26.870
But let's just say, hey, you want to go ahead and use this, so I'll walk you through that.

00:26.880 --> 00:31.500
How you can utilize this and what's the difference between having a local installation as well as online

00:31.500 --> 00:32.760
and how you can utilize that.

00:32.790 --> 00:34.410
Let's go ahead and work on that.

00:34.770 --> 00:40.500
So if you go into MongoDB into the cloud, they provide you this atlas, which is a fully managed cloud

00:40.500 --> 00:41.310
database.

00:41.340 --> 00:46.560
The in simple words, it's just is a machine being spent off in eight of us or Google Cloud.

00:46.560 --> 00:52.440
And on that instance of or the computer, the MongoDB is installed and you can just access that.

00:52.440 --> 00:53.610
That's the whole idea.

00:53.640 --> 00:56.290
Let me walk you through how it goes on and works on with that.

00:56.310 --> 01:01.830
If you go into MongoDB Atlas, you can see there is eight of us Cloud and Azure where you can just install

01:01.830 --> 01:02.040
it.

01:02.040 --> 01:06.630
They're going to help you to provision these databases and stuff and you can just go ahead and click

01:06.630 --> 01:07.290
on Get Started.

01:07.290 --> 01:13.830
Now, it will ask you to install it will ask you to just go ahead and sign in and you can sign in using

01:13.830 --> 01:17.100
the Google or maybe just an email that's also doable.

01:17.130 --> 01:21.990
Now, once you are into this, this is the very first screen you're going to see apart from this first

01:21.990 --> 01:25.040
cluster being spent of that is not going to be the case in your way.

01:25.050 --> 01:27.600
This cluster takes 2 to 3 minutes to spin off.

01:27.600 --> 01:30.330
That's why I've already got it up here so that I can walk you through.

01:30.450 --> 01:33.090
The first thing that you have to do is just click on this create button.

01:33.090 --> 01:36.300
Right now there will be nothing onto your screen, so just click on the create.

01:36.330 --> 01:41.100
It will ask you what kind of cluster you want to create a dedicated, a serverless or a basic one.

01:41.100 --> 01:44.250
Basic one obviously is the free, so that's what we'll be using up.

01:44.430 --> 01:49.440
So if you click on the basic, it says that you can install it into a cloud provider like eight of Lewis

01:49.440 --> 01:50.700
Cloud or Azure.

01:50.730 --> 01:54.600
The good thing is you don't have to create an account on iOS or Cloud or anything.

01:54.600 --> 01:55.890
You don't have to do that.

01:55.950 --> 01:59.940
Just click on eight of Lewis, make sure whatever the region is selected for you, it's good enough.

01:59.940 --> 02:03.870
They automatically selects the region based on which one is nearer for you.

02:03.870 --> 02:06.720
In my case, they are not doing a good job, but that's fine.

02:06.720 --> 02:11.280
But you can choose for like Mumbai or Singapore or anything like that, and then you don't have to choose

02:11.280 --> 02:12.660
anything like cluster or anything.

02:12.660 --> 02:13.620
Just don't touch anything.

02:13.620 --> 02:15.210
Just click on Create Cluster.

02:15.420 --> 02:18.480
As soon as you are going to create the cluster, this will go back.

02:18.480 --> 02:20.550
Let me go ahead and click on the clusters.

02:21.530 --> 02:24.020
This is going to be the screen for you.

02:24.020 --> 02:28.580
And this is screen will remain here for like two, 3 minutes, maybe 5 minutes or a little bit more.

02:28.580 --> 02:30.740
Once this is all done, you're going to see like this.

02:30.740 --> 02:31.670
But that's not it.

02:31.670 --> 02:33.620
There are a couple of more things now.

02:33.620 --> 02:38.180
You can do that using the database access and the network access, but I'll show you the shortcut that

02:38.180 --> 02:41.090
how you can easily create and connect this with this cluster.

02:41.180 --> 02:45.740
Just click on this connect and you're going to notice that right now you cannot connect to this cluster

02:45.740 --> 02:48.200
because your network setting is not great.

02:48.200 --> 02:50.600
So I told you, remember the network access.

02:50.600 --> 02:52.730
That's what we are accessing directly from here.

02:52.760 --> 02:54.830
Just click on allow access from anywhere.

02:54.830 --> 02:59.390
This will allow all the IP address to be able to connect from your database and that's exactly what

02:59.390 --> 02:59.930
we'll be doing.

02:59.930 --> 03:02.030
So just click on Add IP address.

03:02.240 --> 03:05.060
Once this is all done, that means your network settings are great.

03:05.060 --> 03:10.130
Now you need to have a user access setting as well so that somebody can actually log in into a database

03:10.130 --> 03:11.060
and use that.

03:11.060 --> 03:16.010
This setting is not there into the local database installation because you are admin, you just can

03:16.010 --> 03:17.660
directly log in and install that.

03:17.660 --> 03:22.910
So let just say I'm going to go ahead and say that my user name is and the password that I'm going to

03:22.910 --> 03:26.390
be using is let's just say hit the ish and one.

03:26.390 --> 03:31.250
So anything that is secure and great that you can use, it's not really that great.

03:31.250 --> 03:34.910
You can use auto generate password to have a secure password for yourself.

03:34.940 --> 03:40.490
Then just go ahead and click on Choose a Connect String Method, make sure you remember this password

03:40.490 --> 03:42.710
because this will not automatically be filled for you.

03:42.710 --> 03:47.990
You need to manually fill that click on Choose Connection Method and now you can go ahead and use the

03:47.990 --> 03:50.570
connection I want to use in an application.

03:50.570 --> 03:54.620
So I'll click on this and then you just need this entire URL.

03:54.710 --> 03:59.660
Make sure in this entire URL you replace your username with your actually username, whatever you have

03:59.660 --> 04:03.260
just entered and the password as your posta password and that's it.

04:03.290 --> 04:04.310
That's all you need.

04:04.310 --> 04:09.890
Wherever I use the string local host instead of that local host colon port, you have to use this string

04:09.890 --> 04:10.610
and that's it.

04:10.610 --> 04:11.450
That's it.

04:11.450 --> 04:13.850
There is no difference at all apart from this.

04:14.600 --> 04:19.670
We're going to just go ahead and hit the close and now you are already and all set to connect with this

04:19.670 --> 04:20.210
database.

04:20.210 --> 04:25.100
Just wanted to show you a couple of more things in case you find anything different in the network setting

04:25.100 --> 04:26.810
or the settings that we have just done.

04:26.810 --> 04:31.490
Just click on the network access and this is exactly where the setting goes in case you want to allow

04:31.490 --> 04:37.340
only limited IP is to be accessible to your database and the database access gives you the idea of who

04:37.340 --> 04:40.700
is the database and what's the password and everything that you have set up right now.

04:40.700 --> 04:43.670
This is authentication method, but you can change that.

04:43.670 --> 04:46.160
You won't need it much, but this is all what we have.

04:46.160 --> 04:48.620
So go into the databases and there we go.

04:48.620 --> 04:49.730
This is our cluster.

04:49.730 --> 04:54.920
Now, this is entirely a free tier, but they also delete these free resources which are not being used

04:54.920 --> 04:55.670
after some time.

04:55.670 --> 04:57.050
So make sure you take care of that.

04:57.050 --> 05:01.640
If you create an instance which is a dedicated one, it's going to cost you some money, but it's much

05:01.640 --> 05:02.480
more for longer.

05:02.480 --> 05:06.470
So once you are done with this entire course, you can definitely spin off this, all of this.

05:06.470 --> 05:12.710
So that's the basic of using a MongoDB atlas in case you don't want to install MongoDB on your local

05:12.710 --> 05:13.250
database.

05:13.250 --> 05:18.860
But again, yes, I know I have repeated many times please install MongoDB on a local instance.

05:18.860 --> 05:20.960
Let's go ahead and catch up in the next video.
