How to Install MongoDB on Windows 10

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys in this video I'm going to show you how you can download and install MongoDB on your Windows 10 operating system MongoDB is a free and open-source cross-platform document-oriented database it is also classified as a no SQL database program so let's see how we can install MongoDB on our Windows 10 operating system so first of all open your favorite browser and search for MongoDB and the first link which will appear here will be from www.movinon.com this button now once this MongoDB download center page is open you will be able to see different options here the one we want to download and install is the community server so just click on the community server and then select windows and you will be able to see only one option here which is windows 64-bit x64 and just click on this Downloads button which is going to start the download of this MongoDB MSI file so once the download of this MSI file is complete I'm going to click on this MSI file and I'm going to minimize the browser so now you will see this installation wizard so first you just need to click Next and then you need to accept the license terms and conditions and then click Next and on this next window you will see two options one is complete and other is custom we are going to use the complete option so we are going to install the complete version of MongoDB with the extra features and on the next window you will see this option which says install MongoDB as a service so I'm going to leave this as default which says run service as Network service user and it's also going to create two directories one is the data directory and other is the log directory at the locations specified here in these boxes so I don't want to change anything I will leave everything as default and click Next and this next window will ask you if you want to install a MongoDB compass which is official graphical user interface for MongoDB so I will just leave this checkbox as checked and I'm going to click Next so now the installation of MongoDB has been started so I will wait for the installation to complete and after the installation of MongoDB is successfully finished you will see this window it says completed the MongoDB and it will ask you to click the finish button so I'm going to click the finish button now once the MongoDB is installed on our Windows operating system I'm going to go to the location where MongoDB is installed so just go to your C directory and then Program Files and you will be able to see this MongoDB folder here and then click on server and then click on whatever version of MongoDB you have installed there will be a folder created with that version name so I'm going to click on this version name and then you will be able to see all these files and folders here so now click on the bin folder and here you will find all the MongoDB related executable files so to start MongoDB you need to run this file which is D and in order to open the MongoDB client you need to run this file which is so I will just copy this part here so in order to run the D command I am going to start the command prompt so just right-click on this windows icon and then choose command prompt which is going to start the command prompt and then I'm going to CD to the folder where this D and files are there so CD and paste the part you have copied for this bin folder and then I'm going to press Enter so inside this bin folder all these files are located right so we are now inside this bin folder and here you just need to run this de command so just run D and then press Enter which is going to start the MongoDB server but after the starting of MongoDB server it's going to give you this error which says that there is a special directory required which is undersea data and DB which is not found so we need to create this data directory and inside this data directory we need to create the DB directory in order to run this D command so we are going to create this directory so I will go to the C directory and here I will create a new directory with the name data so let's create this directory and inside this data directory I am going to create a new directory with the name DB so just create the new directory with the name DB now this folder path is existing on my Windows operating system so once again I'm going to run this D command and then once you run this D command it's not going to give you any problem and you can see demon has been started so once this daemon is started I'm going to open the next terminal so right click on this Windows icon and then click on command prompt and once again I am going to CD to the directory where my and D executable files are there so once again CD to the bin directory of MongoDB and now I will run the command so just give this command which is and then press ENTER which is going to open the shell so you can see here at the bottom this shell is open I'm going to just minimize this so you will be able to see this here and let me just minimize this folder Explorer so in order to show all the databases which are already there you just give this command show DB's which is going to show you all the default databases which are already existing inside your MongoDB now let me just increase the font size of this terminal so you will be able to see all the commands clearly let me change it to 20 font size and now in order to create a new database using ma go DB you use this command use and the name of your database so let's say I want to create a database called my Lib so just give the name of your database after use and this is going to create this database but still when you give the show DBS command it's going to only show you the old databases and not the new one this is because you need to insert some data into your database in order to see it using the show DBS command so in order to insert some data you just need to give this command we have already switched to this my Lib database using this use my lib command and now you just need to give this command DB dot the name of your collection let's say my collection name is books and then dot insert and give the parentheses and inside the parentheses you give the curly brackets and you give your values as Jason's so inside the curly brackets you just need to provide that key name so let's say the key name is name and then colon so the value I'm going to give here is MongoDB book let's say and then I'm going to press Enter which is going to create this collection and insert this document into your collection and once again when you give this show DBS command you will see our database is now listed here now in order to list out all the collections inside your database you just need to give this command which is show collections and then the semicolon and then press ENTER which is going to show all the collections which are present inside your database so we have only created one collection which is books inside our my Lib database that's why we see only one collection here now in order to see all the values which are present inside your collection you just need to give once again DB command and then the name of your collection so DB dot books and then give the find command in order to list all the equipments inside the collection and when you give this command you will see all the documents which are present inside your collection so this is how you can use this client so whenever you need to use the client you always need to start the daemon on the other shell so let me just close these two shells and once these shells are closed let's say I want to open the command Trond once again and this time I want to run the D command from anywhere so let's say I give the mangodi command but it's going to give this error which says D is not recognized as an internal or external command so in order to recognize your de command or command from anywhere you need to set the environment variable for the DB so once again I'm going to go to the folder where I have the MongoDB installed so I'm going to go to the MongoDB server and the version and then the bin directory and then copy the part of this bin directory and once again right click on the windows icon and then click on the system option here and once the system window is open you just need to click advanced system settings and then click on environment variables and here you need to add the DB path to the path environment variable so under system variable you will find this variable name called path so just double click on it and then we are going to click on new and add the part of the binary directory of your MongoDB so just copy and paste the whole path for your MongoDB executable this is the same path which we have copied which is this one and once you have pasted this MongoDB path you can just click OK ok and ok and once you have done that you can just once again open the terminal so you need to close the terminal and open the command prompt once again and this time when you give the D command it's going to recognize this D command from anywhere wherever you are in your folder structure and once again I'm going to open the next command prompt and give the command in order to open the shell and it will open also the shell from anywhere wherever you want to open the client now if you remember when we ran the MongoDB installation wizard we have checked a checkbox which says run D as a service now for that to take effect you need to restart your Windows operating system and then when you restart your Windows operating system the D service will automatically start by itself and then you don't even need to run D in a different terminal you can directly open your terminal and give the command in order to connect to your server so let me just restart my Windows operating system and then we will check whether the D is running automatically or not so now I have restarted my Windows operating system and now I will open the command prompt once again by right-clicking on the windows icon and clicking on command prompt and once the command prompt is open I'm not going to give the D command in order to start D I will just give the command and then press Enter and you can see this client is connecting to the server without even running the mangodi command in the different terminal so now because D is running as a service on your Windows operating system you can directly use the command in order to connect to your server so this is how you can download and install MongoDB on your Windows 10 operating system I hope you have enjoyed this video and I will see you in the next video you
Info
Channel: ProgrammingKnowledge
Views: 465,573
Rating: 4.9067359 out of 5
Keywords: MongoDB, Database, Open Source database, NoSql, Installing MongoDB, MongoDB Tutorial for Beginners, starting mongodb linux, install mongodb on linux, Mongodb, overview, Advantages, Environment, Data Modelling, Create Database, Drop Database, Create Collection, Drop Collection, Insert Document, Query Document, Update Document, Replication, install MongoDB, How to install MongoDB, MongoDB on Windows 8, MongoDB on Windows, Windows 10, Windows 8, collection, MongoD, databases, server
Id: FwMwO8pXfq0
Channel Id: undefined
Length: 13min 20sec (800 seconds)
Published: Sat Oct 13 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.