Lab - Using $lookup

Hi guys,

I have successfully solved the problem, the issue that I saw is in aggregation within $match I am using $in to check filter document however in solution its done using filter. And the count of the result is different.

I have also compared my query with the detailed answer query and the only difference I saw was around $match.

Can someone explain, what I missed by not using Regex.

Thanks in advance.

I had the same issue but instead I was using $or and I got different counts.

EDIT: It turns out that the field airplane could have values like: โ€œ747 380 320โ€ which cannot be matched with exact โ€œ747โ€ or โ€œ380โ€.
That is why we need to use regex /747|380/

1 Like

@Ivo_02187 Thanks mate :slight_smile: