Now to get started with the aggregation pipeline,
we need some data and I will use our persons data again,
you'll find it attached to this video one more time.
We'll import it with mongo import and you should make sure that you run this command in the folder where
you store your persons.json file so that you can simply enter the file name and you're good to go
and then I'll store it in a database which I'll name analytics,
the name is of course up to you
and then a collection which I'll name persons.
I will also add the json array flag here, that is required because the persons.json file has an array
of documents. With that, I can now hit enter and this should import 5000 documents into the database.
Now let's connect to the database with our shell
and there, let's use our analytics database where we should see our persons collection.
Now just to bring this back in memory, a person looks like this,
we get quite a lot of data on a person including things like some dummy location and this is all random
data, just to stress this again,
so some dummy location, the age and some other data as you can see here.
Now let's see how we can use the aggregate framework on this.