$or operator and regex alteration operator produces different results

If you go to this lab and change the first stage to { $or: [{ airplane: "747" }, { airplane: "380" }] }, you get a different result than the answer given in the detailed answer section.

I wonder why this happens, since $or and the regex alteration operator seem to behave functionally the same way.

PS: I’m not elaborating too much because I don’t want to give the answer to those who haven’t passed this lab yet.

The following is a strict equality

It will only match the exact string 747, It is not a

It will not match Anything747, 747Anything and certainly not Anything747MoreThings.

2 Likes

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