Before we dive into the actual code, there's one important thing you have to know and that is that
you have to understand how the work between management of the database, probably through the shell and interacting
with the database through the driver,
how these two parts are separated or split up, how you split the work.
Now for the shell,
so what we used in this course, you'll typically stay to the shell for things like configuring the database,
creating collections or creating indexes because these are tasks which you typically do up front,
so when you set up the backend for your application. You don't really do that right from inside the
driver because the driver is tightly coupled to your application, to your application logic
and if you're building an online shop for example, your code will basically be responsible for handling
products, users, for working with orders and things like that.
The initial database setup is not something your application deals with,
it assumes that the database is there and that you can then communicate with the database.
So this whole setup stuff will be done from inside a shell or basically up front. From inside the driver,
so from inside your application so to say, you typically perform these different crud operations to store
new data in the database or retrieve or update or delete it and you might also work with the aggregation
pipeline to, well fetch data in a more structured way
if your application requires that and the data format in a database doesn't fit the format you need it in,
so this is how you can roughly split the responsibilities.
Now technically you can absolutely create collections and indexes from inside the driver,
so that is possible
but with that, why don't we just have a look at all of that in an example application which I prepared
and where we can now continue to work on.