The expressive $lookup syntax is quite complicated, and there is no template for it in Compass (yet?). As it is, we have to type it in by hand from the video, and the video is not clear.
It would be nice if there were a cut-and-paste template for that, underneath the video lecture itself, similar to the current one received from Compass:
{
from: '<<string>>',
localField: '<<string>>',
foreignField: '<<string>>',
as: '<<string>>'
}
Something like, e.g:
{
from: <<string>>,
let: { <<var1>>:<<inner_var>>},
pipeline: [
{ <<operator>>: { $expr: { $eq: [ <<outer_var> , <<var_1>> ] } } },
],
as: <<string>>
}