1
00:00:02,150 --> 00:00:05,430
So enough of the theory for now,

2
00:00:05,430 --> 00:00:07,980
let's install MongoDB and

3
00:00:07,980 --> 00:00:11,630
all the tools we need for spinning up databases,

4
00:00:11,630 --> 00:00:13,800
for interacting with databases,

5
00:00:13,800 --> 00:00:17,943
and the best place to start with that is Mongodb.com.

6
00:00:19,030 --> 00:00:23,600
Now on this page, you got various offerings,

7
00:00:23,600 --> 00:00:27,060
you've got cloud services and you've got software.

8
00:00:27,060 --> 00:00:32,060
Now, cloud services are in the end, managed MongoDB

9
00:00:32,557 --> 00:00:35,010
servers running on some cloud machines.

10
00:00:35,010 --> 00:00:37,720
So hosted by MongoDB company

11
00:00:37,720 --> 00:00:41,754
And we'll take a look at some of these parts

12
00:00:41,754 --> 00:00:42,587
later in the course

13
00:00:42,587 --> 00:00:45,400
for the moment, let's focus on software,

14
00:00:45,400 --> 00:00:50,400
which is software, We install locally on our system.

15
00:00:50,400 --> 00:00:51,600
Now in this lecture,

16
00:00:51,600 --> 00:00:55,000
I'll start with macOS, in the next lecture,

17
00:00:55,000 --> 00:00:58,605
I'll show you how to install and start MongoDB,

18
00:00:58,605 --> 00:01:00,813
and the MongoDB server on Windows.

19
00:01:01,780 --> 00:01:05,269
For Linux, I unfortunately don't have a Linux machine.

20
00:01:05,269 --> 00:01:06,230
So therefore,

21
00:01:06,230 --> 00:01:09,107
I have to point you at the official docs and therefore,

22
00:01:09,107 --> 00:01:10,730
you should actually stick around

23
00:01:10,730 --> 00:01:13,000
for a couple of extra seconds here

24
00:01:13,000 --> 00:01:14,770
even if you are not using Mac,

25
00:01:14,770 --> 00:01:17,450
because I want to dive into those docs together with you

26
00:01:17,450 --> 00:01:20,472
first before we then do continue

27
00:01:20,472 --> 00:01:23,550
with the macOS setup in this lecture here.

28
00:01:23,550 --> 00:01:25,850
But first of all, let's take a closer look at the software

29
00:01:25,850 --> 00:01:28,400
where we can install.

30
00:01:28,400 --> 00:01:29,490
Most importantly,

31
00:01:29,490 --> 00:01:33,560
we've got a community server and an enterprise server.

32
00:01:33,560 --> 00:01:37,940
Now the community server is a free version of MongoDB

33
00:01:37,940 --> 00:01:40,750
of all you need for working with MongoDB

34
00:01:40,750 --> 00:01:44,303
And that's the version we're going to use in this course.

35
00:01:46,140 --> 00:01:51,140
The enterprise server adds more additional enterprise level

36
00:01:51,810 --> 00:01:56,570
features, but this does not affect how MongoDB works

37
00:01:56,570 --> 00:01:58,740
or which command you can execute.

38
00:01:58,740 --> 00:01:59,573
Instead here,

39
00:01:59,573 --> 00:02:03,210
we're talking about additional configuration or security

40
00:02:03,210 --> 00:02:05,480
features that might matter to you

41
00:02:05,480 --> 00:02:08,180
if you are a big enterprise.

42
00:02:08,180 --> 00:02:11,250
But for developing with MongoDB,

43
00:02:11,250 --> 00:02:13,110
the community server is all we need

44
00:02:13,110 --> 00:02:16,360
and when it comes to deploying MongoDB,

45
00:02:16,360 --> 00:02:19,593
we'll take a look at these cloud offerings again, later.

46
00:02:20,530 --> 00:02:22,000
Now, we also got more tools.

47
00:02:22,000 --> 00:02:25,830
Most importantly Compass is also noteworthy.

48
00:02:25,830 --> 00:02:30,830
It's a graphical user interface that allows you to interact

49
00:02:31,080 --> 00:02:34,800
with your database and to view the data in your database.

50
00:02:34,800 --> 00:02:39,030
It's a little bit like MySQL workbench for MySQL,

51
00:02:39,030 --> 00:02:42,850
if you've worked with that, but we'll ignore it for now.

52
00:02:42,850 --> 00:02:45,750
Instead, we'll install the community server

53
00:02:45,750 --> 00:02:47,500
and for this we can click on it

54
00:02:47,500 --> 00:02:49,720
and we should be taken to a page that looks

55
00:02:49,720 --> 00:02:51,700
something like that.

56
00:02:51,700 --> 00:02:54,670
Here you can select the version and I'll use the latest

57
00:02:54,670 --> 00:02:56,020
stable one.

58
00:02:56,020 --> 00:02:58,840
And then your operating system, actually,

59
00:02:58,840 --> 00:03:02,370
your operating system should already be preselected,

60
00:03:02,370 --> 00:03:04,670
but you can select from a wide range

61
00:03:04,670 --> 00:03:06,610
of operating systems here

62
00:03:06,610 --> 00:03:10,750
including windows and a bunch of Linux distributions to make

63
00:03:10,750 --> 00:03:14,143
sure you're downloading MongoDB for the correct system.

64
00:03:15,360 --> 00:03:18,791
And then you can click this download link here to start the

65
00:03:18,791 --> 00:03:23,791
download and download MongoDB or these core tools that you

66
00:03:23,810 --> 00:03:25,693
need onto your system.

67
00:03:26,532 --> 00:03:29,690
Now we'll take a look at what we downloaded there in a

68
00:03:29,690 --> 00:03:33,410
second, but for the moment, let's go to the docs here,

69
00:03:33,410 --> 00:03:35,080
the documentation,

70
00:03:35,080 --> 00:03:38,270
and here we want to go to the server documentation,

71
00:03:38,270 --> 00:03:40,880
which actually is a great resource

72
00:03:40,880 --> 00:03:44,480
to look up MongoDB features in general,

73
00:03:44,480 --> 00:03:45,990
and we're going to go through

74
00:03:45,990 --> 00:03:47,770
all these key features throughout

75
00:03:47,770 --> 00:03:49,670
this course, for the moment,

76
00:03:49,670 --> 00:03:52,233
Let's dive into the installation documentation,

77
00:03:53,760 --> 00:03:56,650
and here we want to view the docs for installing the

78
00:03:56,650 --> 00:03:57,810
community edition.

79
00:03:57,810 --> 00:04:02,710
And now you can choose the guides for your operating system.

80
00:04:02,710 --> 00:04:06,470
And it's a great idea to go through these written guides.

81
00:04:06,470 --> 00:04:08,070
In addition to this video,

82
00:04:08,070 --> 00:04:11,633
especially if you should get stuck, or if you are on Linux.

83
00:04:15,308 --> 00:04:17,190
Now, if we install it on macOS

84
00:04:17,190 --> 00:04:18,660
we've got different ways of

85
00:04:18,660 --> 00:04:20,300
installing MongoDB,

86
00:04:20,300 --> 00:04:22,920
we could also install it with Homebrew,

87
00:04:22,920 --> 00:04:26,460
which is a command line tool. You can run on your system,

88
00:04:26,460 --> 00:04:29,600
but we did actually download this Tarball.

89
00:04:29,600 --> 00:04:32,810
So we're going to go through these installation steps here

90
00:04:34,030 --> 00:04:35,610
and now in there, we, first of all,

91
00:04:35,610 --> 00:04:38,223
have to download this Tarball.

92
00:04:38,223 --> 00:04:40,440
There's a zipped folder in the end,

93
00:04:40,440 --> 00:04:42,840
which we did a couple of seconds ago.

94
00:04:42,840 --> 00:04:44,560
Then we have to unzip it,

95
00:04:44,560 --> 00:04:46,950
which you can do as instructed here,

96
00:04:46,950 --> 00:04:48,900
but even easier than that,

97
00:04:48,900 --> 00:04:53,060
you can also just locate that downloaded TGZ file,

98
00:04:53,060 --> 00:04:56,790
which in the end just unzipped file and double click on

99
00:04:56,790 --> 00:04:57,910
it in finder

100
00:04:58,900 --> 00:05:02,280
here, I moved it into some software folder,

101
00:05:02,280 --> 00:05:05,930
which I created somewhere in my user folder on MacOS

102
00:05:05,930 --> 00:05:09,350
but you can move and extract it anywhere you want.

103
00:05:09,350 --> 00:05:12,290
Then I'll delete the zip file. And then here,

104
00:05:12,290 --> 00:05:15,250
I got a folder with a couple of files in it,

105
00:05:15,250 --> 00:05:18,090
especially with a bin folder inside of it,

106
00:05:18,090 --> 00:05:23,090
where we then got a variety of executable files in the end.

107
00:05:24,500 --> 00:05:25,540
And for us,

108
00:05:25,540 --> 00:05:28,480
the most important files will be the MongoD

109
00:05:28,480 --> 00:05:30,423
and the Mongo file.

110
00:05:34,540 --> 00:05:38,690
Mongo D will be an executable file that actually allows us

111
00:05:38,690 --> 00:05:42,250
to start the MongoDB database server,

112
00:05:42,250 --> 00:05:45,820
which is the server that hosts the databases and which needs

113
00:05:45,820 --> 00:05:48,880
to be up and running for us to interact with them and with

114
00:05:48,880 --> 00:05:50,720
the data in them.

115
00:05:50,720 --> 00:05:54,680
And the Mongo executable actually will be a shell,

116
00:05:54,680 --> 00:05:57,930
which we can use to talk to that server.

117
00:05:57,930 --> 00:06:01,340
So that will be the tool we use for running queries against

118
00:06:01,340 --> 00:06:03,170
the database server.

119
00:06:03,170 --> 00:06:04,420
Now, as I mentioned before,

120
00:06:04,420 --> 00:06:07,070
there's also a graphical user interface.

121
00:06:07,070 --> 00:06:10,490
You could use MongoDB Compass, but actually

122
00:06:10,490 --> 00:06:11,500
for this course,

123
00:06:11,500 --> 00:06:14,500
we're going to stay in the shell because it is about

124
00:06:14,500 --> 00:06:17,240
learning these commands and query commands

125
00:06:17,240 --> 00:06:20,210
and while executing them through the shell is the most

126
00:06:20,210 --> 00:06:22,730
straightforward way of doing so.

127
00:06:22,730 --> 00:06:26,120
A graphical user interface can be a nice tool to help,

128
00:06:26,120 --> 00:06:28,318
but it will not be our main way of interacting

129
00:06:28,318 --> 00:06:29,840
with MongoDB.

130
00:06:31,560 --> 00:06:34,980
Now, of course, with MySQL, we did actually use the,

131
00:06:34,980 --> 00:06:37,010
MySQL workbench a lot,

132
00:06:37,010 --> 00:06:40,421
but there keep in mind that we had to do things like

133
00:06:40,421 --> 00:06:44,920
configuring our database and the table structures in there

134
00:06:44,920 --> 00:06:48,350
with MongoDB and no SQL databases in general

135
00:06:48,350 --> 00:06:52,350
that's not a main task we have to do because there is no

136
00:06:52,350 --> 00:06:55,080
database or a table structure.

137
00:06:55,080 --> 00:06:57,970
Instead, it's only about running these commands

138
00:06:57,970 --> 00:07:00,900
and if you recall the MySQL section there,

139
00:07:00,900 --> 00:07:02,830
we also ran commands,

140
00:07:02,830 --> 00:07:06,190
sequel statements with help of MySQL workbench

141
00:07:06,190 --> 00:07:08,410
But in the end we just executed commands there

142
00:07:08,410 --> 00:07:10,723
we type commands and executed them.

143
00:07:11,690 --> 00:07:13,760
And we're going to do the same thing here

144
00:07:13,760 --> 00:07:15,570
with this Mongo shell,

145
00:07:15,570 --> 00:07:19,140
just without the overhead of this graphical user interface,

146
00:07:19,140 --> 00:07:22,330
which has a lot of options, which we don't need.

147
00:07:22,330 --> 00:07:23,163
So that's why,

148
00:07:23,163 --> 00:07:25,290
these will be the two important things for us

149
00:07:25,290 --> 00:07:26,790
in this course section here

150
00:07:27,830 --> 00:07:30,453
but how do we now execute these files?

151
00:07:31,410 --> 00:07:32,840
You could double click on them,

152
00:07:32,840 --> 00:07:35,150
but that's not really how we want to do that

153
00:07:35,150 --> 00:07:37,060
instead, we want to invoke them

154
00:07:37,060 --> 00:07:39,200
through the terminal here on macOS

155
00:07:40,560 --> 00:07:42,500
and to do this efficiently

156
00:07:42,500 --> 00:07:46,890
we want to make them available as global commands on our

157
00:07:46,890 --> 00:07:47,723
system.

158
00:07:49,030 --> 00:07:52,630
And the official documentation tells us how we can do that

159
00:07:52,630 --> 00:07:55,940
effectively, we got these two approaches here,

160
00:07:55,940 --> 00:07:56,800
which we can use.

161
00:07:56,800 --> 00:08:01,800
We can copy the files into this user local bin folder here,

162
00:08:02,040 --> 00:08:05,750
or we create so-called symbolic links.

163
00:08:05,750 --> 00:08:08,730
Now this might sound a bit more advanced than these commands

164
00:08:08,730 --> 00:08:11,100
might look a bit more advanced, but in the end,

165
00:08:11,100 --> 00:08:14,880
what we're doing with that is we're turning these executable

166
00:08:14,880 --> 00:08:16,750
files into commands.

167
00:08:16,750 --> 00:08:20,453
We can run from inside the terminal on our system,

168
00:08:21,570 --> 00:08:24,990
just as we could run the node command from inside the

169
00:08:24,990 --> 00:08:26,873
terminal on our system.

170
00:08:29,880 --> 00:08:33,250
Now to make that all work on macOS, it's easiest

171
00:08:33,250 --> 00:08:35,780
if you right click onto the bin folder

172
00:08:36,669 --> 00:08:38,278
and you then open a new terminal

173
00:08:38,278 --> 00:08:40,273
at that folder,

174
00:08:42,110 --> 00:08:42,943
alternatively,

175
00:08:42,943 --> 00:08:45,580
you open your terminal just like that.

176
00:08:45,580 --> 00:08:50,580
And you then #cd you navigate into that path where these

177
00:08:50,587 --> 00:08:54,620
files are located. So into the bin folder here, ultimately,

178
00:08:54,620 --> 00:08:55,453
but it's,

179
00:08:55,453 --> 00:08:58,290
if you just do right click here and opened a terminal

180
00:08:58,290 --> 00:09:01,550
already navigated into the path by clicking this option

181
00:09:02,920 --> 00:09:05,010
And then what you want to do is

182
00:09:05,010 --> 00:09:07,470
you want to run this command here

183
00:09:07,470 --> 00:09:09,030
from the official docs

184
00:09:10,690 --> 00:09:13,420
So copy that command, paste it in there,

185
00:09:13,420 --> 00:09:15,870
but don't execute it yet.

186
00:09:15,870 --> 00:09:19,020
Instead, since we're already in that bin folder,

187
00:09:19,020 --> 00:09:23,270
we want to shrink this first part here to just copy

188
00:09:24,988 --> 00:09:26,700
. / *

189
00:09:26,700 --> 00:09:30,300
which copies the content of the current folder into this

190
00:09:30,300 --> 00:09:31,850
folder, which you want to keep,

191
00:09:32,920 --> 00:09:34,070
then hit enter,

192
00:09:34,070 --> 00:09:37,280
and you might be prompted for your password here.

193
00:09:37,280 --> 00:09:39,710
And once you entered your password correctly,

194
00:09:39,710 --> 00:09:42,530
which I didn't manage to do on the first two tries,

195
00:09:42,530 --> 00:09:43,550
as you can see,

196
00:09:43,550 --> 00:09:44,540
this should be done

197
00:09:46,020 --> 00:09:48,700
now to verify that this not all worked

198
00:09:48,700 --> 00:09:52,370
simply type Mongo into your terminal,

199
00:09:52,370 --> 00:09:55,470
and this might give you a warning like this,

200
00:09:55,470 --> 00:09:58,173
so that it's not allowed to start.

201
00:09:59,050 --> 00:10:00,440
If that happens,

202
00:10:00,440 --> 00:10:03,840
go to your system preferences and there to security and

203
00:10:03,840 --> 00:10:05,920
privacy, and then there,

204
00:10:05,920 --> 00:10:07,470
and click on allow any way

205
00:10:08,800 --> 00:10:12,280
due to same for all the other MongoDB commands

206
00:10:12,280 --> 00:10:14,420
you might execute throughout this course

207
00:10:14,420 --> 00:10:16,873
Whenever you get this warning you just saw.

208
00:10:18,320 --> 00:10:20,870
once you did that, if you try running Mongo again,

209
00:10:20,870 --> 00:10:22,500
this time to get a different warning,

210
00:10:22,500 --> 00:10:24,340
we can click open there,

211
00:10:24,340 --> 00:10:29,020
and now it executes it still crashes because actually it

212
00:10:29,020 --> 00:10:31,840
fails to connect to a MongoDB server,

213
00:10:31,840 --> 00:10:35,290
but it at least did recognize this command now.

214
00:10:35,290 --> 00:10:37,233
And that's the important thing here.

215
00:10:39,480 --> 00:10:41,540
Now what's missing at this point though,

216
00:10:41,540 --> 00:10:43,710
is the database server itself.

217
00:10:43,710 --> 00:10:47,340
We need to start that before we can actually successfully

218
00:10:47,340 --> 00:10:49,380
run Mongo, the Mongo shell,

219
00:10:49,380 --> 00:10:51,563
and connect to it and work with it.

220
00:10:52,720 --> 00:10:55,934
Now in a database server would be started by running the

221
00:10:55,934 --> 00:10:58,050
Mongo D command,

222
00:10:58,050 --> 00:11:00,160
But before we run this,

223
00:11:00,160 --> 00:11:03,910
we have to prepare our system a little bit, to be precise

224
00:11:03,910 --> 00:11:08,560
we have to prepare POV folders on our system

225
00:11:08,560 --> 00:11:11,540
where MongoDB will be able to store

226
00:11:11,540 --> 00:11:16,403
the actual database data and some log files,

227
00:11:17,800 --> 00:11:20,830
because when working with a database like MongoDB,

228
00:11:20,830 --> 00:11:23,880
but the same is true for all databases. Of course,

229
00:11:23,880 --> 00:11:27,330
eventually the data will be written to your hard drive and

230
00:11:27,330 --> 00:11:31,243
you need to tell MongoDB where data should be written to.

231
00:11:32,280 --> 00:11:36,820
Therefore what you want to do is you want to create some POV

232
00:11:36,820 --> 00:11:40,083
on your system where that data should be stored.

233
00:11:41,420 --> 00:11:44,020
And for this here, I got a development folder,

234
00:11:44,020 --> 00:11:46,490
which is directly in my user folder,

235
00:11:46,490 --> 00:11:49,570
where I will create a MongoDB folder.

236
00:11:49,570 --> 00:11:52,090
And in there I'll add a data folder

237
00:11:52,090 --> 00:11:54,573
and I'll add a logs folder.

238
00:11:55,660 --> 00:11:58,920
Now you can add such a structure anywhere on your system.

239
00:11:58,920 --> 00:12:02,340
Just make sure that it's somewhere in your user folder in

240
00:12:02,340 --> 00:12:06,840
the end, so that you have full read and right access to it.

241
00:12:06,840 --> 00:12:10,790
So don't create it in some reserved system path or anything

242
00:12:10,790 --> 00:12:11,623
like that.

243
00:12:13,570 --> 00:12:16,640
Instead, your user folder is a good starting point

244
00:12:16,640 --> 00:12:19,480
And then some sub folder there is a good starting point

245
00:12:19,480 --> 00:12:20,313
In my case,

246
00:12:20,313 --> 00:12:23,680
it does development folder where I have the MongoDB folder

247
00:12:23,680 --> 00:12:26,940
where I have these folders I just created.

248
00:12:26,940 --> 00:12:29,810
So usually create a structure that looks something like this

249
00:12:29,810 --> 00:12:30,963
folder wise.

250
00:12:32,540 --> 00:12:35,700
Now, once you have these empty data and logs folders,

251
00:12:35,700 --> 00:12:38,653
you can actually now start Mongo D.

252
00:12:39,860 --> 00:12:42,810
Now, first of all, we can run Mongo D just like this,

253
00:12:42,810 --> 00:12:44,410
because it will fail anyways,

254
00:12:44,410 --> 00:12:46,223
because MacOS will block it.

255
00:12:47,330 --> 00:12:48,630
So to work around that, again,

256
00:12:48,630 --> 00:12:52,320
we go to the system preferences and allowed us anyways,

257
00:12:52,320 --> 00:12:54,520
and now we could run it successfully.

258
00:12:54,520 --> 00:12:56,360
But before we now run it again,

259
00:12:56,360 --> 00:12:59,060
we want to configure it a little bit.

260
00:12:59,060 --> 00:13:01,807
So we'll type Mongo D and then a blank.

261
00:13:01,807 --> 00:13:04,650
And now we want to make MongoDB

262
00:13:04,650 --> 00:13:09,650
aware of the data and logs POV we just created

263
00:13:10,610 --> 00:13:12,847
And for this, you add a so-called flag,

264
00:13:12,847 --> 00:13:16,228
a so-called option to this command to configure this

265
00:13:16,228 --> 00:13:17,061
command.

266
00:13:17,940 --> 00:13:22,940
You do this by typing dash dash and then DB path is the

267
00:13:23,521 --> 00:13:25,280
option name we want to add here.

268
00:13:25,280 --> 00:13:27,440
And with that, we can tell MongoDB

269
00:13:27,440 --> 00:13:29,220
where the data should be stored

270
00:13:29,220 --> 00:13:31,420
So that's a special option MongoDB

271
00:13:31,420 --> 00:13:33,040
would be watching for

272
00:13:34,120 --> 00:13:36,880
then you add a blank and then the path where the data should

273
00:13:36,880 --> 00:13:39,800
be stored, and to get that path,

274
00:13:39,800 --> 00:13:42,710
you can go to that data path, you created

275
00:13:42,710 --> 00:13:45,100
and right click on it and choose

276
00:13:45,100 --> 00:13:47,000
get info here on macOS

277
00:13:48,110 --> 00:13:51,390
and then you can copy this path here

278
00:13:51,390 --> 00:13:55,433
in the where part and paste it in here,

279
00:13:56,650 --> 00:14:00,990
and now just make sure that it ends with slash data or

280
00:14:00,990 --> 00:14:03,763
whichever name you chose for your data folder.

281
00:14:04,770 --> 00:14:06,337
So that is the first important part

282
00:14:06,337 --> 00:14:08,370
with that will tell MongoDB

283
00:14:08,370 --> 00:14:09,680
where to store the data

284
00:14:09,680 --> 00:14:12,940
And you want to add this option whenever you restart your

285
00:14:12,940 --> 00:14:14,860
Mongo DB server.

286
00:14:14,860 --> 00:14:15,693
For example,

287
00:14:15,693 --> 00:14:18,750
if you was shuts down your operating system and you

288
00:14:18,750 --> 00:14:19,820
restarted it,

289
00:14:19,820 --> 00:14:23,130
and you now want to restart your Mongo DB server to work

290
00:14:23,130 --> 00:14:26,123
with it again, you have to restart it like this again,

291
00:14:27,130 --> 00:14:30,450
but we're still not done. Add another blank.

292
00:14:30,450 --> 00:14:31,330
And here for me,

293
00:14:31,330 --> 00:14:34,540
it's doing it in a new line because I ran out of space here,

294
00:14:34,540 --> 00:14:37,480
but it's technically still the same command in the same

295
00:14:37,480 --> 00:14:38,313
line.

296
00:14:38,313 --> 00:14:41,463
It just added this line break for readability reasons don't

297
00:14:41,463 --> 00:14:44,510
hit enter, because that would confirm to command

298
00:14:44,510 --> 00:14:47,350
And you don't want to do that yet instead,

299
00:14:47,350 --> 00:14:50,660
just add a blank and then also add another option

300
00:14:50,660 --> 00:14:53,943
with dash dash and that's the Logpath option.

301
00:14:54,940 --> 00:14:58,300
And here, we now want to get the path to our logs folder,

302
00:14:58,300 --> 00:15:01,100
which of course is the same path just ending with slash

303
00:15:01,100 --> 00:15:02,430
logs in my case

304
00:15:03,350 --> 00:15:05,710
to point at this logs folder

305
00:15:07,170 --> 00:15:08,040
Now, for the logs,

306
00:15:08,040 --> 00:15:11,330
you then also actually have to point at a concrete file that

307
00:15:11,330 --> 00:15:12,500
should be created.

308
00:15:12,500 --> 00:15:16,640
So add another slash and then Mongo.log

309
00:15:16,640 --> 00:15:18,643
like that The name is up to you,

310
00:15:18,643 --> 00:15:21,890
but Mongo.log is a common name for that log file

311
00:15:22,730 --> 00:15:26,260
for the data path you did not specify such a file

312
00:15:27,880 --> 00:15:29,050
Now you can hit enter,

313
00:15:29,050 --> 00:15:32,330
and you might see another warning where you have to

314
00:15:32,330 --> 00:15:35,270
confirm that you want to open this command, this tool,

315
00:15:35,270 --> 00:15:36,180
but with that,

316
00:15:36,180 --> 00:15:40,110
eventually it should now start this Mongo DB server

317
00:15:40,110 --> 00:15:41,930
successfully.

318
00:15:41,930 --> 00:15:44,750
And you can tell that it's successful by the fact that it

319
00:15:44,750 --> 00:15:46,250
does not crash.

320
00:15:46,250 --> 00:15:50,610
And that you now start at such an ongoing process.

321
00:15:50,610 --> 00:15:53,970
You're not back to the regular input mode anymore. Instead,

322
00:15:53,970 --> 00:15:55,486
this is a running process,

323
00:15:55,486 --> 00:15:58,770
which you can always quit with Control + C

324
00:16:00,020 --> 00:16:01,000
so by pressing

325
00:16:01,000 --> 00:16:02,660
control + C

326
00:16:02,660 --> 00:16:03,690
But if you do quit,

327
00:16:03,690 --> 00:16:06,610
you won't be able to interact with the database anymore.

328
00:16:06,610 --> 00:16:09,990
You have to restart it then to do that again.

329
00:16:09,990 --> 00:16:13,400
So as long as you are working with dad, Mongo DB database,

330
00:16:13,400 --> 00:16:16,040
you want to keep that process up and running.

331
00:16:16,040 --> 00:16:19,170
So you don't want to close that terminal window and you

332
00:16:19,170 --> 00:16:22,430
don't want to hit control + C here instead

333
00:16:22,430 --> 00:16:25,553
Now we can open a new terminal window, for example,

334
00:16:25,553 --> 00:16:29,510
by pressing command + N here on macOS

335
00:16:29,510 --> 00:16:31,790
So I still have the other process running here,

336
00:16:31,790 --> 00:16:34,450
and now I have my new window here,

337
00:16:34,450 --> 00:16:35,340
And in here,

338
00:16:35,340 --> 00:16:38,193
we can now try to connect to this running server.

339
00:16:39,080 --> 00:16:41,410
And we do this by running this Mongo command,

340
00:16:41,410 --> 00:16:42,730
which I showed you before,

341
00:16:42,730 --> 00:16:45,283
which under the hood uses this Mongo shell.

342
00:16:46,380 --> 00:16:47,730
If you hit enter like this,

343
00:16:47,730 --> 00:16:50,379
it should automatically connect to your server.

344
00:16:50,379 --> 00:16:54,120
It gives a bunch of log information output here,

345
00:16:54,120 --> 00:16:56,890
but eventually it will connect.

346
00:16:56,890 --> 00:16:58,760
And now that you are connected,

347
00:16:58,760 --> 00:17:01,093
you can interact with that server.

348
00:17:02,070 --> 00:17:03,810
For example, in here,

349
00:17:03,810 --> 00:17:07,559
you can run show DBS to see all the databases that are

350
00:17:07,559 --> 00:17:10,560
running on your database server,

351
00:17:10,560 --> 00:17:14,119
and you'll have some default databases out of the box here.

352
00:17:14,119 --> 00:17:17,590
Now that's the point where we'll stop here.

353
00:17:17,590 --> 00:17:19,930
We'll pick up on this in the next lectures again,

354
00:17:19,930 --> 00:17:22,069
if you're facing any problems here,

355
00:17:22,069 --> 00:17:25,000
definitely have a look at these official docs for MacOS

356
00:17:26,000 --> 00:17:28,010
to go through the installation

357
00:17:28,010 --> 00:17:29,210
Step-by-step again,

358
00:17:29,210 --> 00:17:32,830
with help of that written guide and eventually have that

359
00:17:32,830 --> 00:17:37,380
running server and connected shell on your system as well.

360
00:17:37,380 --> 00:17:39,233
Now let's continue with windows.

