You can download mongodb compass from the compass page on the mongodb page. You can
find it on solutions
and there, simply compass.
Now on that page, you can simply click on try it
now and there, compass should be selected,
your operating system should be selected
otherwise you can change it here and you simply download that and you'll get an installer through which
you can walk and this should be pretty straightforward.
Once this installation process finished and I already installed it for me, you can start up compass
and you should start on a page that looks something like this, where you can connect to a host.
Now it's important that you have a mongod server up and running
and I do,
I'm also connected to it in the shell and you see, this is actually an empty server,
no databases, no data,
I cleared everything before this module by simply deleting everything in the db folder where the data
gets stored.
You could of course also have some data in there, doesn't matter
and I got a mongod instance running and that is the instance to which we'll connect. Now the default settings
actually already do suffice for connecting,
we want to connect to localhost and to this port,
so if you didn't change anything here, you can just click connect and you're connected to your local
mongodb server.
Now you see the three default databases,
now here we could actually create a new database,
for example we could add some contact data with a contacts collection and click create database. In
the contact data,
we now have the contacts collection and as you see, we can even insert a document here and there, we could
insert a name, Max, we could insert an age, 29 and we can change the type of that too, we could say that
should be simply int32 for example. We can then add another field and that could be my location and
for location, I'll actually add an object which is simply a nested, an embedded document
and for the embedded document, I will add a special type of object which I'll explain a bit deeper later in
the geospatial module
where I'll set a type field to point, this is string, point. And then I'll add coordinates and coordinates
will actually be an array
and here the first value will be a double and that double let's say is 56.12 and then the second element
also is a double
and that is let's say 43.09.
Now let's click insert here and this was now inserted,
now you also see other tabs besides your documents,
these are all things which will make more sense once we progress through the course, for example the
aggregation framework module will show you how you can aggregate data in the shell but thereafter, this
page will make more sense to you because what you learn in the shell later in that module is something
you can also replicate in the user interface by then. Explain plan and indexes will make more sense after
the indexes module where you learn what indexes are and why we use them
and here you can explore which indexes are attached to your collection, which kind of index it is,
you can also create a new index and you can understand how your queries are executed.
Speaking of queries, you can execute queries here too, right now
I'm finding all documents as you can see.
Now you can also on this page of course filter for different things, you can write a query as you'll
learn in this course
and as you already saw it a bit,
you could for example search for age being able to 29
and of course you would find that same document, if I searched for age 30 though, I'll not find anything.
So you can play around with that and explore your data here
a bit to get a feeling for what's inside
and of course, you can not just insert data and view data,
you can also edit and change it. So for example here, I could update Max to be 30 years old, simply click
update here and you're good to go
and if you want to get rid of a user suddenly, you could of course also delete this user and click delete,
now I'll not do that here but it would be as easy as that.
Now that location thing here, that object, this is just showing you that you can add a nested object as
well and an array
and this is actually a special type of object which you'll also learn more about in the geospatial
module.
So this is compass and this is a super short module obviously. Compass is a nice graphical user interface
which you simply should be aware of and even though I will not use it for the rest of this course because
this being a developer course, I'll focus on the code, you can always come back and log into your database
server with compass to explore your data, to easily manipulate it, to try out some queries and later in
the indexes module,
also explore indexes and explain tab and in the aggregations module,
play around with this graphical user interface.
This is mongodb compass,
now there's one other thing to mention and that is that this is the community edition.
If you are using mongodb enterprise, mongodb compass will have one cool feature and that is
the schema tab which we don't have here.
This allows you to explore the schema of your data in greater detail, so you can see how many documents
do have a string for a name or a string for age maybe if you have mixed data. For location data like this
one, you would also see a map and you could explore your entries on that map for multiple documents.
So with the enterprise version, you get a bit more features but for basic exploration and editing, the
community edition which comes for free should suffice.