$match lab result

I am having a problem with the $march lab. I’ve double and tripe checked the match conditions and there is no way I can get 23 as the result, I get 877.
Not sure how to get help as we should not post potential answers.
And advice?


Hey @Rupinder_79772

I am pretty sure that the Forum guidelines state that you are not allowed to post answers or potential answers to the labs or final exams. Perhaps you should delete your post. :slight_smile:

Hey @mradochonski

Perhaps you could check out the suggestions that @DHz gave in this post having a similar problem with this lab. Specifically that part about using .find() to ‘test’ each part of the $match stage.

Thanks for make me clear and I’ll take care for the same in future.

1 Like

Thanks @natac13, problem solved.

1 Like

I’m having the same problem…not getting the count expected. Please confirm my understanding of the logic as follows:

  • imdb.rating is at least 7 : simple greater than or equal test
  • genres does not contain “Crime” or “Horror” : test that the genres array does not contain Crime OR Horror, but may contain other values
  • rated is either “PG” or “G” : test that the rated field contains PG OR G only
  • languages contains “English” and “Japanese” : test that languages contains English AND Japanese, in addition to any other values (TBD…I’ve also tried this as containing ONLY English AND Japanese and this does not result in the correct value either)

Thank you for the help…

nevermind…I figured it out. I had wrong operator in the languages query.

1 Like