Relationships$lookup: The JOIN You Didn't Expect
All courses

Joining across collections

$lookup performs a left outer join. $unwind flattens arrays. It works — just not as fast as a well-modeled embed on hot paths.

SQL refugees breathe a sigh of relief. Then check the query plan.

Output
Press Run to execute your code.