Conditional $lookup

By way of information, doing ifNull: [$someFieldCouldBeNull, []] doesn’t really work anymore, seems like empty array matches anything “null” in the lookup collection now. Running latest mongodb v7.0, so at some point in the previous releases this behavior probably changed. I’m not sure if there is a better “don’t match anything” projection, seems funny to do “DO_NOT_MATCH_ANYTHING” as the string, but it’s what I do for now :slight_smile: