$group and accumulators Lab question

Hi Guys,

I am getting the following result which does not match with any of the choices given:

{ “highest_rating” : 9.6, “lowest_rating” : 4.5, “avg_rating” : 7.490729001584786, “deviation” : 0.653728117401871 }

The number of matching documents for “awards” query is 1262 for me. What am I doing wrong?

hey Ragesh I am getting exactly the same answer as you. i did a $match first filtering out all docs that have the text Won in the awards field then did the $group. I am still unsure as to why this is not working.

Hello, Can someone please provide some sort of hint here? I modified my $match criteria to check for the existence of “awards” field in all the documents and then apply the regex "^Won ". I still get 1262 as the matching document number.

@Rajesh_61192 hey man i managed to figure it out. It all comes down to the regex and how you are filtering the movies out in the $match stage. Lil hint I used $and and $or with regex

Hello Ryan,

Thanks for the hint. I’ll give that a shot.


Hello Ryan,

Thanks for the hint. I was able to solve the problem. As you mentioned it all comes down to how I filter the “movies” out and the regex. I looked closely at the schema and realized what I was doing wrong. After fixing the $match criteria I got 914 matching documents.

Appreciate your help!