1 00:00:01,030 --> 00:00:03,850 We've now got a very simple express application put together. 2 00:00:03,850 --> 00:00:07,250 So now we're gonna start to set up Mongo DB inside of our project. 3 00:00:07,300 --> 00:00:11,500 Let's first get a quick reminder on what Mongo DB is and why we're using it. 4 00:00:12,010 --> 00:00:12,340 Okay. 5 00:00:12,370 --> 00:00:17,360 So we're going to use an outside server or an outside database called Mongo DB. 6 00:00:17,380 --> 00:00:23,530 This server is going to store all of our user data and location data so user data is essentially all 7 00:00:23,530 --> 00:00:26,000 the different accounts that a user might create. 8 00:00:26,050 --> 00:00:30,820 So user data would be like an email and a password tied to that email. 9 00:00:30,820 --> 00:00:34,060 We're also gonna store all of our different location data here as well. 10 00:00:34,060 --> 00:00:39,670 So a given user can have many different tracks and remember a track is essentially a collection of points 11 00:00:39,880 --> 00:00:42,330 that we eventually want to render on a map. 12 00:00:42,370 --> 00:00:48,400 So our Mongo DV instance is also going to store all that location data as well in order to work with 13 00:00:48,400 --> 00:00:50,950 Mongo DV from our Express API. 14 00:00:50,950 --> 00:00:56,320 We're going to use a library called Mongoose which we actually just installed in the last video or two. 15 00:00:56,650 --> 00:01:00,210 It's now that we've created our library where we've got Mongoose already installed. 16 00:01:00,280 --> 00:01:05,650 The only other thing we have to do is setup Mongo DV either on our local machine or using some outside 17 00:01:05,650 --> 00:01:07,090 service. 18 00:01:07,090 --> 00:01:12,060 So in this course we're going to use a free hosted copy of Mongo DB. 19 00:01:12,070 --> 00:01:17,500 We're using a free hosted copy because it's very easy to setup and also has a very nice UI that we can 20 00:01:17,500 --> 00:01:24,080 use to inspect all the data that could say to our database so in order to set up a free hosted instance 21 00:01:24,080 --> 00:01:28,340 of Mongo DV I'm going to navigate to the lengthy see right here inside of a new browser tab 22 00:01:31,220 --> 00:01:36,140 once you get to this page you're going to be prompted to log in if you have already created a mongo 23 00:01:36,140 --> 00:01:37,370 DB account in the past. 24 00:01:37,400 --> 00:01:43,130 Then go ahead and sign in with it otherwise click on register right there to sign up for a new account. 25 00:01:43,130 --> 00:01:47,110 I already have a mongo DB account so I'm going to sign in right now. 26 00:01:49,670 --> 00:01:52,180 All right once were signed in for the first time. 27 00:01:52,340 --> 00:01:55,300 We're going to be taken to a dashboard page of sorts. 28 00:01:55,490 --> 00:01:57,490 So it might look a little bit like this. 29 00:01:57,590 --> 00:02:01,340 You also if you're signing up for an account for the very first time you might see a kind of welcome 30 00:02:01,340 --> 00:02:02,830 screen or something like that. 31 00:02:02,870 --> 00:02:08,630 Essentially what we want to do right now is build a cluster or create a new database so whatever flow 32 00:02:08,630 --> 00:02:09,770 you get entered into. 33 00:02:10,040 --> 00:02:13,800 Well essentially we're just trying to find that green button that says build a cluster. 34 00:02:13,880 --> 00:02:18,780 If you don't see that button right away try to find the clusters link over here on the left hand side. 35 00:02:18,980 --> 00:02:23,700 It's going to click on build a cluster and then we're going to be prompted with a little setup was there 36 00:02:23,700 --> 00:02:24,560 right here. 37 00:02:25,170 --> 00:02:31,620 Now when we create a cluster Mongo DB can create a mongo instance on any of three different cloud providers 38 00:02:31,620 --> 00:02:32,380 for us. 39 00:02:32,490 --> 00:02:36,080 So either NWS GOOG cloud platform or Windows ASR. 40 00:02:36,420 --> 00:02:39,130 It really does not matter what provider you use. 41 00:02:39,150 --> 00:02:40,280 Just pick one at random. 42 00:02:40,290 --> 00:02:43,740 There's really no difference whatsoever for what we're doing here. 43 00:02:44,430 --> 00:02:48,750 Once you select a provider you can then click on the different locations here. 44 00:02:48,840 --> 00:02:52,980 Just make sure that you select a free tier available option. 45 00:02:52,980 --> 00:02:58,210 In general you want to find the location closest to your physical location the world but do make sure 46 00:02:58,210 --> 00:03:03,120 that you select one that has a free tier available so I'm gonna go with North Virginia right here for 47 00:03:03,120 --> 00:03:08,670 myself because there is a free tier available I should see free appear on the bottom left hand side 48 00:03:09,970 --> 00:03:16,840 and then on the bottom right click on Create cluster now creating the cluster says right here that takes 49 00:03:16,840 --> 00:03:18,400 between seven and 10 minutes. 50 00:03:18,430 --> 00:03:22,540 I found that actually takes just like two or three so we'll take a quick pause right here. 51 00:03:22,540 --> 00:03:26,890 We'll wait for the cluster to be created and when we come back in the next video we're gonna do just 52 00:03:26,890 --> 00:03:29,480 a little bit further configuration of our cluster. 53 00:03:29,590 --> 00:03:34,110 Inside this UI and then make sure that our server can connect to it so quick possible. 54 00:03:34,150 --> 00:03:36,730 Wrap up this Mongo DB stuff in the next video.