1 00:00:02,070 --> 00:00:04,440 So how can we create documents? 2 00:00:04,650 --> 00:00:11,420 Well you already saw that but we basically have insert one and insert many as alternatives. 3 00:00:11,610 --> 00:00:17,280 The important thing to recognize here is that insert one takes a single document with the values you want to 4 00:00:17,280 --> 00:00:23,970 insert and you can but don't have to specify an ID because if you don't specify one, you will get one automatically 5 00:00:24,470 --> 00:00:27,980 and insert many does the same but with an array of documents, 6 00:00:27,990 --> 00:00:33,900 so with a list of documents that gets inserted. Now there also is a third method, insert, 7 00:00:33,990 --> 00:00:39,260 it's a bit more flexible because it takes both a single document or an array of documents 8 00:00:39,360 --> 00:00:45,540 but I will not bother diving into that because insert was used in the past, insert one and insert many were 9 00:00:45,570 --> 00:00:47,050 introduced on purpose 10 00:00:47,190 --> 00:00:53,130 so that you have to be more clear about what you will do because with insert, your code if you are 11 00:00:53,130 --> 00:00:58,560 writing an application could have been a bit harder to understand because it was not instantly obvious 12 00:00:58,680 --> 00:01:03,690 if you were to insert one or multiple documents and it therefore might have also been a bit more error 13 00:01:03,690 --> 00:01:09,240 prone because you could have ended up in a situation where you expected it to insert multiple documents 14 00:01:09,270 --> 00:01:15,120 but you only inserted one. With insert one and many, due to them being fixed to one syntax, 15 00:01:15,150 --> 00:01:19,280 so one document or an array, you'll get an error if you enter something incorrect 16 00:01:19,350 --> 00:01:22,170 and they're also easier to understand if you see them in code, 17 00:01:22,200 --> 00:01:24,560 so we will focus on insert one and insert many. 18 00:01:24,750 --> 00:01:30,550 And then as I mentioned also on importing data, for that we'll have the Mongo import tool, we'll configure 19 00:01:30,560 --> 00:01:31,790 it a bit like you see here 20 00:01:31,860 --> 00:01:35,000 and I will explain what these options do and how it works. 21 00:01:35,010 --> 00:01:38,170 So with that, let's dive into inserting documents 22 00:01:38,370 --> 00:01:44,220 and let's quickly go over the basics again before I then talk about the a bit more advanced options or extra 23 00:01:44,220 --> 00:01:45,210 things you should know.