So how can we create documents?
Well you already saw that but we basically have insert one and insert many as alternatives.
The important thing to recognize here is that insert one takes a single document with the values you want to
insert and you can but don't have to specify an ID because if you don't specify one, you will get one automatically
and insert many does the same but with an array of documents,
so with a list of documents that gets inserted. Now there also is a third method, insert,
it's a bit more flexible because it takes both a single document or an array of documents
but I will not bother diving into that because insert was used in the past, insert one and insert many were
introduced on purpose
so that you have to be more clear about what you will do because with insert, your code if you are
writing an application could have been a bit harder to understand because it was not instantly obvious
if you were to insert one or multiple documents and it therefore might have also been a bit more error
prone because you could have ended up in a situation where you expected it to insert multiple documents
but you only inserted one. With insert one and many, due to them being fixed to one syntax,
so one document or an array, you'll get an error if you enter something incorrect
and they're also easier to understand if you see them in code,
so we will focus on insert one and insert many.
And then as I mentioned also on importing data, for that we'll have the Mongo import tool, we'll configure
it a bit like you see here
and I will explain what these options do and how it works.
So with that, let's dive into inserting documents
and let's quickly go over the basics again before I then talk about the a bit more advanced options or extra
things you should know.