So we saw embedded documents,
let's now have a look at arrays of data and for that, let's go back to our passengers.
So remember we got our passengers collection, if we find all entries there,
this is how a passenger looked like.
Now let's say we also record the hobbies of our passengers,
for this I'll edit Albert Twostone here
with updateOne,
so by selecting the passenger with the name Albert Twostone, like this and I'll update it by setting
a new field
there, hobbies which is an array marked with square brackets, so this is important,
now it's an array.
And here we can have any kinds of data there,
we could have multiple documents in here, that would be fine but we can all have multiple numbers or
simply strings like sports and cooking,
these are just strings not documents.
So any kind of data you can have in a document can also be in an array in a document.
If I hit enter and I output my passengers, you see Albert now has hobbies,
he's the only passenger with that because we filtered for him and hobbies now a list of data.
It's not a nested or embedded document,
it's a list of strings in this case
and as I said, this could be numbers, this could also be other documents, so you can also have documents
in an array and you can have arrays in documents,
this is possible.
You can even have arrays in nested documents,
this is all possible.