Lab $match (My answer got 14 results)

Below is my var pipeline and I wonder why I only got 14 results?

It is most likely because

{ "$in" : [ "P" , "PG" } }

does not fill the lab’s requirement:

rated is either "PG" or "G"
1 Like

Thanks for reply.

I also try below $or, still got the same 14 results

Also I checked the MongoDB manual, it shows $or and $in are equal when it shares a same field.


Link: https://docs.mongodb.com/manual/reference/operator/query/or/

1 Like

rated is either “PG” or “G” and not “P” and “PG”

2 Likes

Hi,
could you publish the text, with what is required?

Regards

@Shouzheng_Huang , you marked

as the solution. I guess that the following was not clear enough.

It is a course, if the answer is given directly you will not be learning much. Publish what you tried and we can help figure out what is wrong.

Give a man a fish and you feed him for the day, teach him to fish and you feed him for the rest of his life. You are here to learn how to fish, not to eat.

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