Using $reduce for lab 2.1

Hi everyone, first time posting in the discussion forum hoping to find some help.

I am using $reduce to find the num_favs for the movies. Although I know the correct answer, I still get it at position 26 instead of position 25. I was wondering if my approach to use $reduce is the correct way or not?

Hi @Siddharth_16211,

I just implemented $reduce and got the correct result.

In your case, it’s either a coincidence that the answer is in 26 (indicating a completely incorrect implementation) or there’s a double count somewhere.

What’s the title of position 3?

1 Like

Hi @007_jb, I solved the issue. I was confused with the phrasing of the criteria for countries. Thank you for your reply though!

1 Like

I see. Glad it’s solved!