WEBVTT

00:00.930 --> 00:01.890
Okay, everyone.

00:01.890 --> 00:08.400
So now we got our really simple, basic Reddit Reddit scraper up and running, and now we need to look

00:08.400 --> 00:15.030
into how to actually save the data to our database or MongoDB database specifically.

00:15.300 --> 00:24.090
So the provider that we're going to use to get our MongoDB server hosting, we'll use M-lab.

00:24.120 --> 00:31.560
You could also just host your own MongoDB server on your machine local machine or use another third

00:31.560 --> 00:33.960
party MongoDB hosting.

00:33.990 --> 00:41.130
The nice thing about M-lab is that it's free for smaller databases up to 500MB, which actually can

00:41.130 --> 00:42.720
last you a pretty long time.

00:42.990 --> 00:50.760
But it's fine for a small prototyping and development projects and so it's free to sign up, free to

00:50.760 --> 00:51.330
use.

00:51.330 --> 00:55.590
You can go in there and you can make a database.

00:56.670 --> 01:03.370
So after you made an account, you just go in and create a new database.

01:03.370 --> 01:07.600
So let's see, I already made one here called Reddit Data.

01:09.060 --> 01:15.660
So I will just delete this one and show you guys how we go through creating the database in in lab.

01:15.680 --> 01:16.470
In lab.

01:18.450 --> 01:19.830
So let me just.

01:20.620 --> 01:23.170
Enlarge the text a bit here.

01:23.320 --> 01:26.440
So go ahead and say create new.

01:27.440 --> 01:32.240
Inside of this lab home page and we say create new.

01:36.210 --> 01:42.180
Then, Well, it's up to you if you want to use Google Azure, whatever.

01:42.180 --> 01:50.340
I just use Amazon and Select Sandbox, which is the free one, and then select the region that's closest

01:50.340 --> 01:52.800
to me after I click Continue.

01:54.290 --> 01:57.570
And I select Europe because that's the closest one to me.

01:59.300 --> 02:01.880
And then we give the database a name.

02:01.880 --> 02:04.820
So I'll call it Reddit scraper.

02:05.970 --> 02:07.050
And.

02:08.010 --> 02:11.970
Then we just submit the order which is free.

02:18.950 --> 02:19.910
And.

02:20.810 --> 02:25.760
Now this is up a no, it's not up and running yet.

02:25.760 --> 02:29.570
They're still deploying the database, but it's really fast.

02:29.570 --> 02:31.010
You can see it's up now.

02:31.550 --> 02:34.400
So we go ahead, click on the database.

02:35.430 --> 02:36.420
And.

02:37.260 --> 02:40.710
Then we need to create a user for the database.

02:40.710 --> 02:51.030
So we go into users, say add database user, and we just call it Reddit user.

02:51.880 --> 02:55.840
And password will just create a.

02:56.860 --> 02:58.630
Random secure password.

02:58.930 --> 03:04.290
I'm just using LastPass, but feel free to make up your own password.

03:04.300 --> 03:05.230
Of course.

03:06.310 --> 03:07.690
Just copy that in.

03:12.440 --> 03:16.130
So now we have created a user for the database.

03:17.630 --> 03:19.100
We see the user here.

03:20.330 --> 03:23.930
And that was just my last pass coming up.

03:24.680 --> 03:29.150
And I will just save the password in here.

03:29.420 --> 03:30.980
That's my password.

03:31.130 --> 03:35.060
And there's my user, Reddit user.

03:36.040 --> 03:43.090
And they give a suggestion on a URL you can use to connect, which we are going to be using.

03:43.090 --> 03:45.910
So copy this URL you see up here.

03:46.900 --> 03:47.710
Copy that.

03:48.670 --> 03:53.410
And then we'll just paste it here for later use.

03:53.650 --> 03:59.020
So then we copy the user, put it in where it says user here.

04:00.440 --> 04:04.130
Then we copy the password.

04:04.160 --> 04:07.430
Put it in where it says password.

04:09.560 --> 04:11.120
Pretty straightforward, right?

04:11.210 --> 04:14.930
And now we need to get to the mongoose connecting part.
