Chapter 3: Lab - $group and Accumulators

I am supposed to use the normalized_rating for the previous lab in chapter 2
to calculate the standard deviation, highest, lowest, and average imdb.rating.

Also, what field do I group on?

Meant… Am I supposed to use the normalized_rating?

Nope, the normalized_rating is not used here. You just calculate the four values mentioned in the question for the entire set of documents that meet the criteria. The first paragraph only confuses things and would have been better left out of the question.

As for the the field to group on, you don’t want to group on a field, but the entire result set. I think the documentation shows examples such as {"$group": {"_id": null}, ...} but you can use any string that you want and it will group all the documents into a single result.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.