Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranî)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
First things first. Head over to mongodb.com and we're going to click on get MongoDB to download
it.
Now you should be taken to the MongoDB download center and the first tab that's usually selected by
default is their cloud service
so the MongoDB Atlas service which we're going to explore a little bit later on when we actually deploy
our database.
But for now we want to choose the service tab.
And down here you should have your Windows version already pre-selected
and we're going to select the current version of MongoDB.
Now it's really important that you change this package from zip to MSI
because this is going to download a installation wizard and it'll make everything a lot easier for us
going forward.
So once you're done here then just go ahead and click download and now download should begin.
Now once download is completed you should be able to head into your Downloads folder and see this installation
wizard.
It's going to be called something like mongodb
something something something
.msi.
And this is going to be your installer.
And so now if you double click on it it will launch the installation wizard and all you have to do is
click next.
And then we're going to accept the terms of the license and we're going to choose the complete installation
and then you're going to select Run service as a network service user and make note of this directory
path that they've created here for you.
This is where they're going to install MongoDB. It's going to be on the C:\Program Files/MongoDB/
server\4.0.
And I recommend keeping to this exact same file path because we'll need a little bit later on.
So keep it the same and keep a note of it and we're going to come back to it a little bit later on.
So then you're going to select next and we're going to uncheck install MongoDB compass because
we don't actually need it.
And then click next and finally click install to start the installation.
And once installation has complete simply click Finish and you'll exit out of the installation wizard.
All right.
So now that we've successfully installed MongoDB using the installer, if you now go into your C-drive
and you take a look at your program files you should see a folder called MongoDB and inside there's something
called server
and then there's the version of the MongoDB that you installed.
and then finally we get access to our binaries.
Now the next thing I want to do is I'm going to set up the data folder where MongoDB will save our
databases on our local system.
So I want you to go ahead into your C drive,
so make sure that up here says your C drive, and then you're going to create a new folder here and it's going
to be called data.
And then inside that data folder we're going to create a new folder called db and just make sure that
you've typed everything exactly as I have which is lower case data
and then inside data there's something called db. And we're going to leave all of that empty but just check
up here to see that you've got exactly the same kind of file path and directories as I have.
So inside your C drive you got a folder called data inside data
you've got something called db.
Now that we've successfully installed MongoDB we have to get it set up so that we can use it easily
through the hyper terminal.
And in order to do that we first have to check something.
So if you head into Explorer and just go into your C-drive and then scroll down until you see Program
Files, double click on that and we're going to scroll down until we find MongoDB.
Here it is.
And then we're going to go inside that folder and then inside the folder called server.
So now you should see a folder with a version number and this corresponds to the rough version of your
MongoDB
and this says 4.0.
And we want to set up a shortcut so that we can launch our mongo.exe and mongod.exe straight from
our hyper terminal using bash.
And now I want you to open up your hyper terminal and just change directory to your home folder by typing
in cd and then adding the tilde sign.
And once you've navigated there, I want you to go ahead and create a new file called .dash_
profile and it has to be spelt exactly this way.
And then hit enter to create it.
And now that should be created if we do an ls -a we should be able to see it in a list of files
here and there it is .bash_profile.
So this is a hidden file that we've created which is going to tell our hyperterminal that when it starts
up and we want to access mongo and mongod we have a shortcut for it.
So now that we've created that file now we're going to edit it using vim.
So to do that we're going to type vim and then we're going to specify the file that we want to edit which
was .bash_profile.
So now if you hit enter this will now open up that file using the vim text editor which is a command
line based text editor.
Now there's a lot of memes around the vim editor and it's because it's not a graphical user interface
so there aren't any buttons to click on and it's a little bit more complex to get to grips with.
But I'm going to quickly show you how you can use it in a very simple way.
So firstly in order to stand actually be able to type anything in the vim editor we're going to hit
the i key, so 'i' for indigo on your keyboard and that will initiate the insert mode. And now you can actually
start typing stuff into this editor. And you can either type this out although it's kind of error prone.
So I would recommend that you head over to the written installations for MongoDB for Windows and there's
a link to this
in the course resources for this module.
And I just want you to scroll down to this part where you see there's this alias mongodb alias mongo
and a file path that we've specified.
I just want you to go ahead and copy both of those two lines and then paste it into vim. So you can
either use the shortcut or you can simply just navigate to it from this little menu icon at the top.
Now the thing you have to change here is we saw earlier on what was the version that you saw and C - program
files - MongoDB - server.
And for me it's 4.0.
Now if you're installing this at some point in the future that might read 4.1 or 5.0 I just want you
to change this part of the code to whatever it is you see there so that they match because this has
to be an entire file path that leads to mongo.exe and mongod.exe.
So if you go ahead again look inside your Explorer and you navigate from local disk C to program
files to MongoDB to server to 4.0 to bin, then you can see here is where our mongo.exe
and mongod.exe reside.
So this file path is going to lead to those files and we're creating simply an alias that makes it easier
for us to work with it inside our hyper terminal.
So if you need to edit this then just go ahead and change these parts to whatever it is that you see
in your version.
And then we're going to go ahead and save and exit vim which can be a little bit tricky but it's not
too hard. You just have to hit ESC to exit insert mode and we're going to type :wq and then
the !.
And now if you hit enter you would have saved that file and you would have exited vim.
So now we're ready to test and see whether if our installation has succeeded.
I want you to go ahead and close down your hyper terminal and you're going to simply relaunch it.
So now that we've restarted our hyper terminal then it's time to test and see if our installation has
succeeded. And we'll do that by writing mongo --version and hit enter.
Now if you see something that looks like this where it says MongoDB shell version 4.0.3 or a new version
but something that looks like this, then congratulations you have completed all of the setup and installation
of MongoDB and you're ready to proceed to the next lesson.
Now if you see something else such as bash mongo not found or something like that where it doesn't look
like this, then be sure to retrace your steps and maybe follow all of the instructions in the written
tutorials and just make sure that you haven't made any typos and anything that you're typing in looks
exactly the same or simply just copy and paste it from the instructions.
But now that we've completed installation and setup then you're ready to get started learning about
MongoDB.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.