1
00:00:02,350 --> 00:00:04,250
In the previous lecture,

2
00:00:04,250 --> 00:00:07,320
we installed MongoDB on macOS,

3
00:00:07,320 --> 00:00:09,930
and we had a look at the documentation and so on.

4
00:00:09,930 --> 00:00:13,453
In this lecture, we're going to install it on Windows.

5
00:00:14,460 --> 00:00:16,210
Now, again, we're going to dive

6
00:00:16,210 --> 00:00:18,860
into the Cloud offerings later.

7
00:00:18,860 --> 00:00:20,840
For the software offerings, we, again,

8
00:00:20,840 --> 00:00:22,860
wanna install the community server,

9
00:00:22,860 --> 00:00:26,720
and now we wanna install the community server on Windows.

10
00:00:26,720 --> 00:00:30,790
It should automatically select a correct Operating System

11
00:00:30,790 --> 00:00:33,970
here on the right, if not, select Windows manually.

12
00:00:33,970 --> 00:00:37,720
And then you can simply download the MSI package,

13
00:00:37,720 --> 00:00:39,170
which is a installer,

14
00:00:39,170 --> 00:00:42,530
which is more convenient to use to install MongoDB,

15
00:00:42,530 --> 00:00:44,333
than using the SIP file.

16
00:00:45,240 --> 00:00:47,350
So let's download this installer

17
00:00:47,350 --> 00:00:49,870
and this can take a short while until it's done,

18
00:00:49,870 --> 00:00:52,180
since the package is a rather big.

19
00:00:52,180 --> 00:00:54,080
But I'll be back once the download finished,

20
00:00:54,080 --> 00:00:55,450
and then we're going to walk

21
00:00:55,450 --> 00:00:57,050
through this installer together.

22
00:00:59,088 --> 00:01:01,850
Okay, so the installation finished for me.

23
00:01:01,850 --> 00:01:03,973
Now I'll start this installer,

24
00:01:05,800 --> 00:01:08,010
and we'll walk through that together.

25
00:01:08,010 --> 00:01:10,280
Of course, we have to accept the license agreement,

26
00:01:10,280 --> 00:01:13,763
and then I'll choose the custom installation mode here.

27
00:01:15,090 --> 00:01:18,550
Now, here, we wanna make sure,

28
00:01:18,550 --> 00:01:23,550
that all these items are selected Client and Server.

29
00:01:23,600 --> 00:01:27,200
The server will be the things serving our databases

30
00:01:27,200 --> 00:01:28,950
and storing our data.

31
00:01:28,950 --> 00:01:32,140
The client will be a tool we use on our local machine

32
00:01:32,140 --> 00:01:33,660
to connect to that server,

33
00:01:33,660 --> 00:01:36,940
to run commands against that server and so on.

34
00:01:36,940 --> 00:01:40,400
And we installed the same combination of tools

35
00:01:40,400 --> 00:01:43,030
in the previous lecture for macOS as well.

36
00:01:43,030 --> 00:01:45,050
And as mentioned there already,

37
00:01:45,050 --> 00:01:47,600
in case you skipped that part there,

38
00:01:47,600 --> 00:01:50,280
we need this client here,

39
00:01:50,280 --> 00:01:53,520
for issuing commands to this server.

40
00:01:53,520 --> 00:01:57,720
And we'll not really use a big graphical user interface

41
00:01:57,720 --> 00:01:59,920
for working with our database.

42
00:01:59,920 --> 00:02:03,320
Instead, no SQL databases in general,

43
00:02:03,320 --> 00:02:07,100
are not really about configuring the database,

44
00:02:07,100 --> 00:02:10,130
or any tables in there, because as you'll learn,

45
00:02:10,130 --> 00:02:14,210
there is no fixed predefined structure you have to set up.

46
00:02:14,210 --> 00:02:17,330
Instead, you really dive right into the commands

47
00:02:17,330 --> 00:02:21,120
that you wanna execute, for inserting data or fetching data.

48
00:02:21,120 --> 00:02:23,640
And that's also just what we did in the end

49
00:02:23,640 --> 00:02:28,100
with MySQL in the SQL course sections.

50
00:02:28,100 --> 00:02:31,240
There, we had a graphical user interface,

51
00:02:31,240 --> 00:02:34,660
but ultimately, we mostly needed that,

52
00:02:34,660 --> 00:02:38,020
for setting up our database and table structure.

53
00:02:38,020 --> 00:02:39,740
And once we had that,

54
00:02:39,740 --> 00:02:42,683
we also just executed commands in there.

55
00:02:44,540 --> 00:02:45,920
Now with no SQL,

56
00:02:45,920 --> 00:02:49,140
since we won't have a structure that we need to set up,

57
00:02:49,140 --> 00:02:51,120
we can skip this part entirely,

58
00:02:51,120 --> 00:02:54,300
and therefore we need no graphical user interface,

59
00:02:54,300 --> 00:02:57,090
since a tool that allows us to run these commands,

60
00:02:57,090 --> 00:02:58,610
will be all we need.

61
00:02:58,610 --> 00:03:01,000
And that's what this client is.

62
00:03:01,000 --> 00:03:03,910
So therefore we should make sure that's installed.

63
00:03:03,910 --> 00:03:06,713
And with that, we can click next here.

64
00:03:07,830 --> 00:03:10,170
Now here's an important screen,

65
00:03:10,170 --> 00:03:13,540
Here by default, this checkbox is checked

66
00:03:13,540 --> 00:03:17,200
that you wanna install MongoD as a service.

67
00:03:17,200 --> 00:03:20,610
MongoD is a process that will be installed

68
00:03:20,610 --> 00:03:24,820
that you would use for spinning up your database server.

69
00:03:24,820 --> 00:03:26,820
And you can do that manually.

70
00:03:26,820 --> 00:03:30,670
And if you uncheck this, you have to do it manually.

71
00:03:30,670 --> 00:03:33,170
But with Windows, the convenient thing

72
00:03:33,170 --> 00:03:35,920
is that we can indeed keep this checked.

73
00:03:35,920 --> 00:03:40,550
And then the MongoDB database server will be started

74
00:03:40,550 --> 00:03:44,150
in the background for us, as a so-called service.

75
00:03:44,150 --> 00:03:47,250
We can still stop and start that manually then,

76
00:03:47,250 --> 00:03:51,130
but we don't have to actively execute some command

77
00:03:51,130 --> 00:03:52,360
to bring that up.

78
00:03:52,360 --> 00:03:55,400
We don't have to keep it running in the foreground.

79
00:03:55,400 --> 00:03:57,870
Instead it will run in the background.

80
00:03:57,870 --> 00:04:00,687
And therefore I will keep this checked here,

81
00:04:00,687 --> 00:04:03,480
and I will keep these default settings.

82
00:04:03,480 --> 00:04:05,830
But now here's an important part as well,

83
00:04:05,830 --> 00:04:09,080
the data and the log directory.

84
00:04:09,080 --> 00:04:10,860
You can keep these default paths,

85
00:04:10,860 --> 00:04:12,510
but I wanna explain what they do.

86
00:04:13,350 --> 00:04:16,777
Like all databases, MongoDB, of course,

87
00:04:16,777 --> 00:04:20,420
ultimately stores the data somewhere on your system.

88
00:04:20,420 --> 00:04:22,410
It manages the data storage for you,

89
00:04:22,410 --> 00:04:26,430
but ultimately data will end up in files on your system.

90
00:04:26,430 --> 00:04:28,460
And it will use this path here,

91
00:04:28,460 --> 00:04:30,240
the data directory path,

92
00:04:30,240 --> 00:04:33,143
for storing the concrete data in files.

93
00:04:34,120 --> 00:04:37,430
It will also log some messages information,

94
00:04:37,430 --> 00:04:39,370
and we'll store that in this path.

95
00:04:39,370 --> 00:04:42,900
That's why these two paths are needed at what they do.

96
00:04:42,900 --> 00:04:45,040
And with that can leave all the settings.

97
00:04:45,040 --> 00:04:48,220
But I wanted to explain why we have those settings,

98
00:04:48,220 --> 00:04:49,740
and click next.

99
00:04:49,740 --> 00:04:51,300
And just as a side note,

100
00:04:51,300 --> 00:04:53,930
if you watched the macOS setup as well,

101
00:04:53,930 --> 00:04:56,930
there we did not set it up as a service.

102
00:04:56,930 --> 00:04:59,750
Instead, there we had some executable files,

103
00:04:59,750 --> 00:05:01,710
which we had to execute manually

104
00:05:01,710 --> 00:05:04,030
to start the database server.

105
00:05:04,030 --> 00:05:05,110
This also works,

106
00:05:05,110 --> 00:05:07,970
but on Windows this here can be more convenient.

107
00:05:07,970 --> 00:05:09,403
So let's click next here.

108
00:05:10,710 --> 00:05:15,710
Now we then also get a chance of installing MongoDB Compass.

109
00:05:15,780 --> 00:05:17,870
On macOS we didn't get that.

110
00:05:17,870 --> 00:05:21,160
We could still install it as an extra tool there,

111
00:05:21,160 --> 00:05:25,410
and you can keep this checked here and click next.

112
00:05:25,410 --> 00:05:30,110
Alternatively, you can also always install it stand-alone,

113
00:05:30,110 --> 00:05:33,300
by going to the MongoDB website and then to software,

114
00:05:33,300 --> 00:05:35,710
and then going to Compass there.

115
00:05:35,710 --> 00:05:38,490
And there, if you click on try it now,

116
00:05:38,490 --> 00:05:40,860
you can also download Compass there.

117
00:05:40,860 --> 00:05:43,170
And that's this graphical user interface,

118
00:05:43,170 --> 00:05:46,923
which you can also use for talking to your database.

119
00:05:47,800 --> 00:05:50,373
Hence I'll click next here, and then install.

120
00:05:52,210 --> 00:05:55,480
Now, once the installation is done, you can click finish.

121
00:05:55,480 --> 00:05:57,060
And now as a first step,

122
00:05:57,060 --> 00:06:00,490
you can open up your Windows Start menu,

123
00:06:00,490 --> 00:06:02,683
and search for Services there.

124
00:06:03,630 --> 00:06:05,573
And open this services tool.

125
00:06:06,470 --> 00:06:08,710
Here you got all the background services

126
00:06:08,710 --> 00:06:11,040
that are running on your system,

127
00:06:11,040 --> 00:06:13,660
and if you scroll down to M there,

128
00:06:13,660 --> 00:06:16,713
you should find MongoDB server there as well.

129
00:06:17,720 --> 00:06:20,060
And it's running by default.

130
00:06:20,060 --> 00:06:21,910
Now this is just database server,

131
00:06:21,910 --> 00:06:23,500
which is running in the background,

132
00:06:23,500 --> 00:06:26,130
as discussed a couple of seconds ago.

133
00:06:26,130 --> 00:06:29,900
You can always right click on it here to stop it.

134
00:06:29,900 --> 00:06:32,160
And then this will shut down this service

135
00:06:32,160 --> 00:06:34,500
and therefore also that database server.

136
00:06:34,500 --> 00:06:35,910
And once it's stopped,

137
00:06:35,910 --> 00:06:37,950
you won't be able to interact with it.

138
00:06:37,950 --> 00:06:41,220
So you won't be able to send commands to it.

139
00:06:41,220 --> 00:06:43,310
Therefore you wanna start it again,

140
00:06:43,310 --> 00:06:46,560
so that you are able to interact with it again.

141
00:06:46,560 --> 00:06:48,890
And that's of course, then a very convenient way,

142
00:06:48,890 --> 00:06:51,133
of starting and stopping that service.

143
00:06:52,230 --> 00:06:55,620
Alternatively, you can open up your Command Prompt,

144
00:06:55,620 --> 00:06:57,800
as administrator.

145
00:06:57,800 --> 00:07:01,690
And in there, you can run net stop MongoDB,

146
00:07:01,690 --> 00:07:03,793
to also stop this service.

147
00:07:05,320 --> 00:07:06,520
And once it's stopped,

148
00:07:06,520 --> 00:07:10,580
you can run net start MongoDB to start it again.

149
00:07:10,580 --> 00:07:13,540
So that's an alternative to using this services tool.

150
00:07:13,540 --> 00:07:15,290
It's up to you, what you wanna use.

151
00:07:16,860 --> 00:07:19,470
So now we got that server running,

152
00:07:19,470 --> 00:07:21,270
but in order to use that server,

153
00:07:21,270 --> 00:07:23,390
we now need to start that client,

154
00:07:23,390 --> 00:07:25,920
that shell, as it's called.

155
00:07:25,920 --> 00:07:28,690
Which allows us to send commands to the server,

156
00:07:28,690 --> 00:07:31,743
queries for inserting or fetching data.

157
00:07:32,730 --> 00:07:35,970
And for this, you should open up your Windows Explorer,

158
00:07:35,970 --> 00:07:39,340
and then go to the path where MongoDB was installed,

159
00:07:39,340 --> 00:07:42,363
by default in C program files MongoDB.

160
00:07:43,570 --> 00:07:46,103
And here I got my server installed,

161
00:07:47,120 --> 00:07:49,640
but if you dive into the bin folder there,

162
00:07:49,640 --> 00:07:52,900
you'll also find the "mongo.exe" file.

163
00:07:52,900 --> 00:07:56,450
And that is actually an executable that you can run,

164
00:07:56,450 --> 00:08:00,570
to start your client, your interactive shell,

165
00:08:00,570 --> 00:08:04,280
that allows you to talk to that server.

166
00:08:04,280 --> 00:08:06,010
So if you double click on that,

167
00:08:06,010 --> 00:08:08,200
this shell opens up, and now here,

168
00:08:08,200 --> 00:08:10,750
you are connected to your server.

169
00:08:10,750 --> 00:08:14,470
In here, in this shell, you can now run commands

170
00:08:14,470 --> 00:08:16,410
to insert data or fetch data.

171
00:08:16,410 --> 00:08:18,410
And of course, that's exactly the part

172
00:08:18,410 --> 00:08:20,260
we're going to dive in in this course.

173
00:08:20,260 --> 00:08:23,710
So that's what we're going to explore in the future here.

174
00:08:23,710 --> 00:08:26,380
For the moment, you can just run show dbs,

175
00:08:26,380 --> 00:08:30,040
to basically list your databases on this server.

176
00:08:30,040 --> 00:08:31,590
So that's a built-in command

177
00:08:31,590 --> 00:08:33,350
that will be understood by the server.

178
00:08:33,350 --> 00:08:36,650
And you should see some default databases here.

179
00:08:36,650 --> 00:08:38,000
And that's it for now.

180
00:08:38,000 --> 00:08:40,409
At the moment, we're not going to do anything else.

181
00:08:40,409 --> 00:08:42,990
You can always close this shell and restart it,

182
00:08:42,990 --> 00:08:45,520
and you can always stop and restart the server.

183
00:08:45,520 --> 00:08:47,180
But as long as you wanna work with it,

184
00:08:47,180 --> 00:08:49,530
it should, of course be up and running.

185
00:08:49,530 --> 00:08:52,430
And with that, let's now continue and dive deeper

186
00:08:52,430 --> 00:08:55,623
into MongoDB, and in how we can work with it.

