Now, before we now get started with diving
into the MongoDB syntax, and how we can write queries,
and run queries against our MongoDB database,
there is one additional tool you might wanna install.
And that's the MongoDB Shell.
Now, actually, we already did install a shell
together with the MongoDB server in the last lecture.
And we already did start the shell there.
That was that tool which we executed in the command line
or by double-clicking on it on Windows
to then connect to our running MongoDB server.
So that tool, which we'll use for inputting commands
for sending commands to the server.
But depending on the point of time
you are watching this course,
that shell might be the old shell,
which is perfectly fine to use.
There's nothing wrong with it,
but there is a newer shell available.
And you either already have that
or you need to install it separately.
And you can tell
whether you already have it by the look of it.
And whether installing
it separately changes anything for you.
Now, to get that newer shell,
you can search for MongoDB Shell.
And you might find this link to the Legacy Mongo Shell,
which is two older one,
which you already might have installed automatically
together with the MongoDB server.
And you should all have find
this MongoDB Shell download link.
Alternatively, you can get there on mongodb.com
by clicking on Software, Developer Tools.
And then there, choosing the MongoDB Shell.
And then here, you can click on Download Now
to be taken to that same page.
Now here again, you can choose your operating system.
There are different versions available
for all the operating systems.
And you can then simply download that shell.
On Windows, instead, you would have this installer,
which you download.
And once downloaded,
we simply execute it and then walk through that installer.
We can keep that default path,
which it chooses here and then choose Next.
And start this installation.
So it's really straightforward here.
And then we're done on Windows.
Now, back on macOS.
Here, we have to extract that ZIP file.
And we'll get a new folder,
which contains such a bin folder.
And in there, you have two different files.
And for us, the Mongo Shell file is the most important one.
But you can grab,
and you should grab both files and copy them.
And then move them to the directory
where you installed your other MongoDB tools.
On macOS, that should be your USR folder.
And you need to make sure that you can view hidden folders
and files to view that.
You can do that by hitting Command + Shift and dot.
And then in that USR folder, go to local bin.
And that's where we copied the other Mongo commands
before when we installed MongoDB on macOS.
So now, move these two new executables into that folder.
You might need to enter your password to do that.
On Windows, you can now open your Windows menu,
the start menu.
And there, search for MongoSH.
So Mongosh and execute this command, this tool,
which is the Mongo Shell we just installed.
And this will open up the Mongo Shell
and connect to your running MongoDB server.
So of course, therefore,
you need to have such a running MongoDB server,
this running service here in case of Windows
so that this connection succeeds.
On macOS, we would typically open our terminal.
And simply execute Mongosh as a command there.
And then connect to our running MongoDB server.
And for this, of course,
we need to have our server up and running there as well.
That is a must have.
Now, you can ignore any warnings
or any messages you might see here.
We don't need to worry about them right now.
Instead, we can now use this shell to interact
with the database.
And then this shell
is connected on both Windows and macOS.
And this shell in the end supports the same commands
you could also use in the old shell.
So you could use either of the two shells,
but it is more future-proof to follow along
with this newer shell.
And maybe you already had this shell as a default shell
right from the start when you first installed MongoDB
in the last lectures anyways.
Now, just as before, you can run show DBs
in here to see a list of your databases.
And there, we got some dummy starting databases,
but I'm now going to continue with this new shell here.