Aggregate help - using lookup for each document in a nested array

Hi!

you probably need to use $unwind on the array so on the next stage you’ll use $lookup for each element
4 things you should keep in mind during aggregations:

  1. filter as much as you can with $match at the beginning of the pipeline
  2. $project only the necessary fields before unwinding the lookup (save memory)
  3. make sure you are not doing a lookup to a massive amount of documents so it will have performance implications
  4. if it’s a recurring query then you should consider storing all of this data together in the same collection.