1 00:00:02,150 --> 00:00:03,930 So we saw embedded documents, 2 00:00:03,950 --> 00:00:11,020 let's now have a look at arrays of data and for that, let's go back to our passengers. 3 00:00:11,030 --> 00:00:16,000 So remember we got our passengers collection, if we find all entries there, 4 00:00:16,070 --> 00:00:17,920 this is how a passenger looked like. 5 00:00:17,980 --> 00:00:22,150 Now let's say we also record the hobbies of our passengers, 6 00:00:22,370 --> 00:00:25,880 for this I'll edit Albert Twostone here 7 00:00:26,770 --> 00:00:29,900 with updateOne, 8 00:00:30,010 --> 00:00:38,280 so by selecting the passenger with the name Albert Twostone, like this and I'll update it by setting 9 00:00:39,580 --> 00:00:40,340 a new field 10 00:00:40,340 --> 00:00:45,780 there, hobbies which is an array marked with square brackets, so this is important, 11 00:00:45,820 --> 00:00:47,180 now it's an array. 12 00:00:47,500 --> 00:00:49,900 And here we can have any kinds of data there, 13 00:00:49,960 --> 00:00:55,810 we could have multiple documents in here, that would be fine but we can all have multiple numbers or 14 00:00:55,810 --> 00:00:59,970 simply strings like sports and cooking, 15 00:00:59,980 --> 00:01:01,920 these are just strings not documents. 16 00:01:01,930 --> 00:01:08,080 So any kind of data you can have in a document can also be in an array in a document. 17 00:01:08,080 --> 00:01:13,300 If I hit enter and I output my passengers, you see Albert now has hobbies, 18 00:01:13,360 --> 00:01:20,080 he's the only passenger with that because we filtered for him and hobbies now a list of data. 19 00:01:20,110 --> 00:01:23,150 It's not a nested or embedded document, 20 00:01:23,230 --> 00:01:25,520 it's a list of strings in this case 21 00:01:25,600 --> 00:01:32,440 and as I said, this could be numbers, this could also be other documents, so you can also have documents 22 00:01:32,440 --> 00:01:35,260 in an array and you can have arrays in documents, 23 00:01:35,260 --> 00:01:36,280 this is possible. 24 00:01:36,310 --> 00:01:39,180 You can even have arrays in nested documents, 25 00:01:39,190 --> 00:01:40,730 this is all possible.