Chapter 4: Lab $facet

I did not get the answer right.

After looking at the answer details, if I understand the answer correctly, we are only using $facet here becuase it gives us the ability to execute multiple pipeline with one aggregation but we are not actually $bucketing anything. So we are using $facets for a technical thing that it gives us (doing several pipelines) not for what we usually use it (bucketing).

Am I correct?

Facets imply that you get different statistics about the collection. At least from my view, you get a “face” of the data.

There is no way to “fork” your data otherwise.

So using $facet is the most facetting thing, and the other 2 are more simplified less powerful facets of the data, and they are extensions of $group

Hi @Elimelech_Wieder,

$facet allows you to run several independent pipelines within the stage of a pipeline, all using the same data, Basically, you can do several calculations in one collections and achieve it in one calculation.

In this particular lab we are calculating both top_metacritic and top_imdb in the same $facet stage.

I hope this clarifies your doubt.

Please feel free to reach out if you have any questions.

Kind Regards,