Installing mongoDB for Windows

Edwin Diaz
A free video tutorial from Edwin Diaz
Web Developer & Premium Udemy Instructor - 700,000 students
4.5 instructor rating • 47 courses • 737,200 students

Learn more from the full course

MongoDB for Beginners - Fast track

Learn to use MongoDB fast and easily with Edwin Diaz

03:40:24 of on-demand video • Updated November 2019

  • You will learn what mongoDB is really about in an easy way
  • Install and use mongoDB
  • Learn all the fundamentals
  • Schema Modeling
  • Learn to use Many Query Methods
  • Learn to connect mongoDB to other languages
  • You will learn how to relate data
  • You will learn about operators
English [Auto] Welcome my dear student. So in this lecture we are going to be installing Mongo TB in Windows operating system. OK so let's go and jump into windows and let's do this. So I got a Windows computer right here. Windows tend to be exact. And we are going to be installing Mongo TB here so I'm going to go to the browser and I already had it installed but I deleted it and I only installed it so that way I can show you how to do it from scratch. OK. So I'm going to go to Google real quick. My best friend and I'm going to go to. I'm going to type in Mongo TB download community. Well I have to type in the order completed it for me and I'm going to go to the download center and I'm going to press on the server tab and you can see here the coding releases for point two at the moment. OK. I'm going to download the package and then I'm going to once I download it. This is just like any other program. Just keep installing it would the with the default settings. So you got to see how I do it. Let's go back here. Nets set the terms nets complete. You can see some data here. Not to worry too much about this. Nets install Mongo TB Compaq's OK. Compass is a gooey is a graphical user interface for Mongo DB. All right. Very similar for those of you that know about BHP HP very similar to BHP admit. OK. You going to be able to see your data with this. So yes I want install it was I gonna show you how to use it later. Nets and he stole it. OK. This is going to take a couple minutes. Do not worry too much about it. I'm going to say yes here. And once it is done then we are gold and we get it we just need to do a couple different configurations real quick just to make things easier after the install was gonna be awesome so I'm going to puzzle video is gonna be a second for you but this is really gonna take around two minutes. OK I'll see you in a second so mine's dilation just finished and I'm just gonna click finish and it's going to be launching the compass. OK this is the go interface so we can use this but you know it's not very useful when we are doing certain things. Okay I'm gonna show you first how to use the shell and later on I'm going to show you how to use this. So basically we are going to be using the Mongo D.B. shell to learn a couple of commands. There are going to be very useful when we start learning how to how the API of Mongo TB works. OK. So that's one of the reasons why we're gonna be using this show now. Now you can go ahead and use this connector right away and start playing around with it but I suggest you turn it off now and there's. Let's continue configuring this stuff. OK. So we haven't we are not done yet. So the next thing we do need to do is create some directories. So I'm going to go to a command prompt command prompt again and I'm going to do MDA here. I'm going to typing this backslash data. This is going to create a data directory in your computer and it is going to create it in this forward slash OK location. Now keep in mind that already have it so I'm going to get an error. You see it says I already exist. Now you do it in your end and you should be good. So MDA forward slash or backslash I'm sorry data. We were going to create the other one and that one already exists on my end. So once you create those two directories the data in the DV inside of data you're good to go. Now all we have to do is do a mongo. Well actually not yet. OK. Because what we want to do is we want to be able to access Mongo D.B. from anywhere in our computer. So right now we need to type in something like this to access it you know like we need to type in the whole path program files then we need to go to mongo D.B.. Then after that I think it's server then the version then the bin directory then Mongo the whatever like there's something like this. Okay. Very similar to this is what we need to type in in order to turn this on. Every time we need from the shell of course. OK. Because right now if I wanted to turn on mongo D.B. from interface or the operating system I can't. So if I wanted to turn on mongo D Mongo D.B. which is not turned on right now I can turn it on by going to the C drive go to the C drive right here Program Files Mongo D.B. server the version Ben and then I can just click on mongo d you see the little leaf that means is an application so a fight well this is the logo for Mongo the Mongol be the little leaf but this is an application. So if I double click it is going to turn it on but that's not what I want I want to be able to turn it on from the shell anytime I want just because we need to use a show. OK so right now I'm just gonna turn it off by turning by closing it but that's how we access it from here. As a matter of fact I'm going to show you again. There we go. That's on. And you can see that little cursor blinking right here. That means it is on me actually right click on this property's front and I'm gonna make this twenty eight. That's huge. You see that little thing blinking that means he's on gays waiting for connections and I can go ahead and use them. The show by going to mongo right. This is the application to this is these two applications that Winnie Mongolia is a server to turn it on and mongoose. This is a Mongol show so I'm going to click it and you can see now that we are inside some type of program. You can see that recursive blinking a little greater than symbol. OK. Now this sucks because I have to go ahead and do this again. OK. So if I do this show the B.S. You can see that it shows me all the databases there. OK. So by before he has ADD ME TO COME figure in the local. OK so I can find compass if I search for compass right here and I open it up. You can see those databases. All right. So I got away a little bit OK. But anyway so it's loading is going to show me the databases like if I go to connect with all the default settings is gonna show me the database admin config and local. Just like our shell. OK. Shell it shows us the same databases. So while we are going to be doing is what I want to do I'm going to close it down. And the way we do that here on the show we can close in here but I like to do it here. Control C let's actually close it here because I opened it up with the user interface with this one here. So I've got to close it here and I'm going to close all these windows. OK. All of it. So what I want to do is I want to be able to access Mongo the Mongol TB from the shell from here from my command prompt. I want to be able to do something like this Mongo. Okay D and turn it on instead of writing the whole path or going to the you know through here. I don't want to do that. So in order for us to do that we have to get the path where that program is located. And we have to add it to our environment variables. So I'm gonna go to program files Mongo DV server four point two bean. And this is where those two file applications are Mongo de and Mongo. Right. So I'm going to click here. I'm going to right click to copy it. I'm going to go back to my computer and I'm going to look for my environment variables screen right here. I'm gonna go to environment variables. I'm going to edit the user variables the path variable. Edit I'm going to add a new one. I'm going to paste that parsing here. Now I have the path I have this path here OK. That means that wherever I am in my computer OK wherever I am if I opened command prompt somewhere anywhere and I type in Mongo DB is going to turn on my server. Now if you will have tried that before you add it to the environment variable it would not work because it's not in your environments. Now in that path variable you need to have it in the path variable. So in the future if you want to start any program by its name make sure you add it to that path. Make sure you add the path to that variable called path and you can. You can just use the name of that program. Okay. So that's a little trick there for you guys. So I'm going to close it down. But before I close it on let me open another window here. Remember this is Mongo D right here. You can see it on top. And he's on because he has a little cursor blinking here. So I need to open another window here and other command prompt to access the show because I can't do it on the same string so I'm going to open another window. I'm gonna type in Mongo enter. See now is greater than symbol and the cursor signifies that I am inside the show. The program. And now I can play around with the database. So if I do show the yes that's a command for Mongo TB shall enter. You can see my databases. OK super simple. Now to get out control. See sometimes you have to press it twice. Control. See again and it's out of there. I'm going to close it now and right here. This is the Mongo deal. This is this server I'm gonna do command control C and control C again to get out. OK I'm going to shut it down and it's going to command prompt again. I'm going to do come out Mongo D to turn it on. And I'm gonna go to open another window. And I'm going to do a mongo walk. These are the two steps to get to the Mongo show super simple right. I wanted you to know control C and control C to turn it off. Control C and control C turn it off. Right. Perfect. So now you know how to install and use Mongo D.B. through the shell and even through the user interface in a Windows operating system. Isn't that awesome guys. Was that easy right. I thought so. If you have any issues those posted in the discussions and we are going to help you out. See you in the next lecture. Guys take care.