Any big application that is built up is always being built up by having all the tools locally installed.
But let's just say for some reason you also want to utilize some of the features that is provided by
the online version of MongoDB.
That is also possible.
Again, I would recommend that you please go ahead and install MongoDB locally.
That will give you so much of advantage rather than these online services.
But let's just say, hey, you want to go ahead and use this, so I'll walk you through that.
How you can utilize this and what's the difference between having a local installation as well as online
and how you can utilize that.
Let's go ahead and work on that.
So if you go into MongoDB into the cloud, they provide you this atlas, which is a fully managed cloud
database.
The in simple words, it's just is a machine being spent off in eight of us or Google Cloud.
And on that instance of or the computer, the MongoDB is installed and you can just access that.
That's the whole idea.
Let me walk you through how it goes on and works on with that.
If you go into MongoDB Atlas, you can see there is eight of us Cloud and Azure where you can just install
it.
They're going to help you to provision these databases and stuff and you can just go ahead and click
on Get Started.
Now, it will ask you to install it will ask you to just go ahead and sign in and you can sign in using
the Google or maybe just an email that's also doable.
Now, once you are into this, this is the very first screen you're going to see apart from this first
cluster being spent of that is not going to be the case in your way.
This cluster takes 2 to 3 minutes to spin off.
That's why I've already got it up here so that I can walk you through.
The first thing that you have to do is just click on this create button.
Right now there will be nothing onto your screen, so just click on the create.
It will ask you what kind of cluster you want to create a dedicated, a serverless or a basic one.
Basic one obviously is the free, so that's what we'll be using up.
So if you click on the basic, it says that you can install it into a cloud provider like eight of Lewis
Cloud or Azure.
The good thing is you don't have to create an account on iOS or Cloud or anything.
You don't have to do that.
Just click on eight of Lewis, make sure whatever the region is selected for you, it's good enough.
They automatically selects the region based on which one is nearer for you.
In my case, they are not doing a good job, but that's fine.
But you can choose for like Mumbai or Singapore or anything like that, and then you don't have to choose
anything like cluster or anything.
Just don't touch anything.
Just click on Create Cluster.
As soon as you are going to create the cluster, this will go back.
Let me go ahead and click on the clusters.
This is going to be the screen for you.
And this is screen will remain here for like two, 3 minutes, maybe 5 minutes or a little bit more.
Once this is all done, you're going to see like this.
But that's not it.
There are a couple of more things now.
You can do that using the database access and the network access, but I'll show you the shortcut that
how you can easily create and connect this with this cluster.
Just click on this connect and you're going to notice that right now you cannot connect to this cluster
because your network setting is not great.
So I told you, remember the network access.
That's what we are accessing directly from here.
Just click on allow access from anywhere.
This will allow all the IP address to be able to connect from your database and that's exactly what
we'll be doing.
So just click on Add IP address.
Once this is all done, that means your network settings are great.
Now you need to have a user access setting as well so that somebody can actually log in into a database
and use that.
This setting is not there into the local database installation because you are admin, you just can
directly log in and install that.
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
be using is let's just say hit the ish and one.
So anything that is secure and great that you can use, it's not really that great.
You can use auto generate password to have a secure password for yourself.
Then just go ahead and click on Choose a Connect String Method, make sure you remember this password
because this will not automatically be filled for you.
You need to manually fill that click on Choose Connection Method and now you can go ahead and use the
connection I want to use in an application.
So I'll click on this and then you just need this entire URL.
Make sure in this entire URL you replace your username with your actually username, whatever you have
just entered and the password as your posta password and that's it.
That's all you need.
Wherever I use the string local host instead of that local host colon port, you have to use this string
and that's it.
That's it.
There is no difference at all apart from this.
We're going to just go ahead and hit the close and now you are already and all set to connect with this
database.
Just wanted to show you a couple of more things in case you find anything different in the network setting
or the settings that we have just done.
Just click on the network access and this is exactly where the setting goes in case you want to allow
only limited IP is to be accessible to your database and the database access gives you the idea of who
is the database and what's the password and everything that you have set up right now.
This is authentication method, but you can change that.
You won't need it much, but this is all what we have.
So go into the databases and there we go.
This is our cluster.
Now, this is entirely a free tier, but they also delete these free resources which are not being used
after some time.
So make sure you take care of that.
If you create an instance which is a dedicated one, it's going to cost you some money, but it's much
more for longer.
So once you are done with this entire course, you can definitely spin off this, all of this.
So that's the basic of using a MongoDB atlas in case you don't want to install MongoDB on your local
database.
But again, yes, I know I have repeated many times please install MongoDB on a local instance.
Let's go ahead and catch up in the next video.