1 00:00:02,140 --> 00:00:06,760 You can download mongodb compass from the compass page on the mongodb page. You can 2 00:00:06,760 --> 00:00:08,100 find it on solutions 3 00:00:08,290 --> 00:00:10,020 and there, simply compass. 4 00:00:10,540 --> 00:00:12,970 Now on that page, you can simply click on try it 5 00:00:12,970 --> 00:00:15,850 now and there, compass should be selected, 6 00:00:15,910 --> 00:00:18,100 your operating system should be selected 7 00:00:18,130 --> 00:00:22,720 otherwise you can change it here and you simply download that and you'll get an installer through which 8 00:00:22,720 --> 00:00:25,810 you can walk and this should be pretty straightforward. 9 00:00:26,080 --> 00:00:31,860 Once this installation process finished and I already installed it for me, you can start up compass 10 00:00:32,470 --> 00:00:37,860 and you should start on a page that looks something like this, where you can connect to a host. 11 00:00:37,870 --> 00:00:41,290 Now it's important that you have a mongod server up and running 12 00:00:41,320 --> 00:00:41,990 and I do, 13 00:00:42,040 --> 00:00:46,400 I'm also connected to it in the shell and you see, this is actually an empty server, 14 00:00:46,480 --> 00:00:47,920 no databases, no data, 15 00:00:47,920 --> 00:00:53,860 I cleared everything before this module by simply deleting everything in the db folder where the data 16 00:00:53,860 --> 00:00:55,260 gets stored. 17 00:00:55,270 --> 00:00:57,730 You could of course also have some data in there, doesn't matter 18 00:00:57,910 --> 00:01:04,180 and I got a mongod instance running and that is the instance to which we'll connect. Now the default settings 19 00:01:04,210 --> 00:01:06,920 actually already do suffice for connecting, 20 00:01:07,000 --> 00:01:09,620 we want to connect to localhost and to this port, 21 00:01:09,670 --> 00:01:15,850 so if you didn't change anything here, you can just click connect and you're connected to your local 22 00:01:15,970 --> 00:01:17,660 mongodb server. 23 00:01:17,950 --> 00:01:20,280 Now you see the three default databases, 24 00:01:20,380 --> 00:01:23,750 now here we could actually create a new database, 25 00:01:23,830 --> 00:01:31,090 for example we could add some contact data with a contacts collection and click create database. In 26 00:01:31,090 --> 00:01:32,140 the contact data, 27 00:01:32,260 --> 00:01:37,300 we now have the contacts collection and as you see, we can even insert a document here and there, we could 28 00:01:37,320 --> 00:01:45,890 insert a name, Max, we could insert an age, 29 and we can change the type of that too, we could say that 29 00:01:45,890 --> 00:01:54,940 should be simply int32 for example. We can then add another field and that could be my location and 30 00:01:54,940 --> 00:02:01,150 for location, I'll actually add an object which is simply a nested, an embedded document 31 00:02:01,570 --> 00:02:07,120 and for the embedded document, I will add a special type of object which I'll explain a bit deeper later in 32 00:02:07,120 --> 00:02:09,170 the geospatial module 33 00:02:09,550 --> 00:02:16,240 where I'll set a type field to point, this is string, point. And then I'll add coordinates and coordinates 34 00:02:16,240 --> 00:02:17,850 will actually be an array 35 00:02:17,980 --> 00:02:28,480 and here the first value will be a double and that double let's say is 56.12 and then the second element 36 00:02:28,780 --> 00:02:30,980 also is a double 37 00:02:31,240 --> 00:02:36,400 and that is let's say 43.09. 38 00:02:36,400 --> 00:02:39,850 Now let's click insert here and this was now inserted, 39 00:02:39,850 --> 00:02:42,670 now you also see other tabs besides your documents, 40 00:02:42,670 --> 00:02:47,740 these are all things which will make more sense once we progress through the course, for example the 41 00:02:47,740 --> 00:02:53,500 aggregation framework module will show you how you can aggregate data in the shell but thereafter, this 42 00:02:53,500 --> 00:02:58,510 page will make more sense to you because what you learn in the shell later in that module is something 43 00:02:58,510 --> 00:03:04,660 you can also replicate in the user interface by then. Explain plan and indexes will make more sense after 44 00:03:04,660 --> 00:03:08,780 the indexes module where you learn what indexes are and why we use them 45 00:03:08,830 --> 00:03:14,470 and here you can explore which indexes are attached to your collection, which kind of index it is, 46 00:03:14,500 --> 00:03:19,150 you can also create a new index and you can understand how your queries are executed. 47 00:03:19,150 --> 00:03:22,960 Speaking of queries, you can execute queries here too, right now 48 00:03:22,990 --> 00:03:25,930 I'm finding all documents as you can see. 49 00:03:26,290 --> 00:03:32,290 Now you can also on this page of course filter for different things, you can write a query as you'll 50 00:03:32,290 --> 00:03:33,140 learn in this course 51 00:03:33,160 --> 00:03:34,920 and as you already saw it a bit, 52 00:03:35,110 --> 00:03:38,420 you could for example search for age being able to 29 53 00:03:38,590 --> 00:03:44,730 and of course you would find that same document, if I searched for age 30 though, I'll not find anything. 54 00:03:44,920 --> 00:03:47,550 So you can play around with that and explore your data here 55 00:03:47,560 --> 00:03:50,130 a bit to get a feeling for what's inside 56 00:03:50,170 --> 00:03:53,910 and of course, you can not just insert data and view data, 57 00:03:53,980 --> 00:04:02,110 you can also edit and change it. So for example here, I could update Max to be 30 years old, simply click 58 00:04:02,140 --> 00:04:03,970 update here and you're good to go 59 00:04:04,210 --> 00:04:10,570 and if you want to get rid of a user suddenly, you could of course also delete this user and click delete, 60 00:04:10,570 --> 00:04:13,490 now I'll not do that here but it would be as easy as that. 61 00:04:13,490 --> 00:04:19,570 Now that location thing here, that object, this is just showing you that you can add a nested object as 62 00:04:19,570 --> 00:04:20,820 well and an array 63 00:04:20,860 --> 00:04:25,840 and this is actually a special type of object which you'll also learn more about in the geospatial 64 00:04:25,840 --> 00:04:26,720 module. 65 00:04:27,040 --> 00:04:33,370 So this is compass and this is a super short module obviously. Compass is a nice graphical user interface 66 00:04:33,430 --> 00:04:39,490 which you simply should be aware of and even though I will not use it for the rest of this course because 67 00:04:39,730 --> 00:04:45,500 this being a developer course, I'll focus on the code, you can always come back and log into your database 68 00:04:45,500 --> 00:04:52,510 server with compass to explore your data, to easily manipulate it, to try out some queries and later in 69 00:04:52,510 --> 00:04:54,310 the indexes module, 70 00:04:54,330 --> 00:04:58,410 also explore indexes and explain tab and in the aggregations module, 71 00:04:58,450 --> 00:05:01,110 play around with this graphical user interface. 72 00:05:01,470 --> 00:05:02,830 This is mongodb compass, 73 00:05:02,860 --> 00:05:08,430 now there's one other thing to mention and that is that this is the community edition. 74 00:05:08,470 --> 00:05:15,850 If you are using mongodb enterprise, mongodb compass will have one cool feature and that is 75 00:05:15,850 --> 00:05:18,340 the schema tab which we don't have here. 76 00:05:18,370 --> 00:05:24,940 This allows you to explore the schema of your data in greater detail, so you can see how many documents 77 00:05:25,180 --> 00:05:32,230 do have a string for a name or a string for age maybe if you have mixed data. For location data like this 78 00:05:32,230 --> 00:05:38,890 one, you would also see a map and you could explore your entries on that map for multiple documents. 79 00:05:38,890 --> 00:05:45,110 So with the enterprise version, you get a bit more features but for basic exploration and editing, the 80 00:05:45,130 --> 00:05:48,080 community edition which comes for free should suffice.