the resulting products field is always empty, and I don’t understand why.
(I know I can use the other $lookup variant with foreignField localField, but I think I need the pipeline because I want to add more clauses to the $match)
To reference variables in pipeline stages, use the "$<variable>" syntax.
The let variables can be accessed by the stages in the pipeline, including additional $lookup stages nested in the pipeline .
A $match stage requires the use of an $expr operator to access the variables. $expr allows the use of aggregation expressions inside of the $match syntax.Without the use of the $expr operator, $match can refer to fields in a document but cannot access variables defined by a $lookuplet clause.
Other (non-$match) stages in the pipeline do not require an $expr operator to access the variables.
Special attention to the sentence A $match stage requires the use of an $expr operator to access the variables.