Using lookup for ref in array of objects

I have the following schema(s):
Customer

{
  _id: "...",
  name: "...",
  email: "...",
}

Hotel:

{
  _id: "...",
  name: "...",
  reviews: [
    {
      _id: "..",
      rating: 1, // number
      content: "...",
      customerId: "..." // ObjectId ref to customer
    },
    {
      _id: "...",
      rating: 1, // number
      content: "...",
      customerId: "..." // ObjectId ref to customer
    }
  ]
}

For simplicity I cut off most of the properties from both models

I am trying to use $lookup to fetch customer data using customerId which is present in the review object within the reviews array, I tried:

Hotel.aggregate(
[
  {
    $lookup: {
      from: "customers",
      localField: "reviews.customerId",
      foreignField: "_id",
      as: "customer"
    }
  }
]
)

But it is not working.

How do I lookup customers using the customerId present in the review object within the reviews array?

Can you provide real sample data?

We cannot really experiment easily with

and

Filling the tree dots with real values in order to experiment is time consuming.

Sorry for that, and for the late response because the website was on maintenance

Customer:

{
  _id: "6259f7dc78e6ee2c49611c04",
  name: "Customer 1",
  email: "example@example.com",
}

Hotel:

{
  _id: "6259f7dc78e6ee2c49611c00",
  name: "Hotel 1",
  reviews: [
    {
      _id: "6259f7dc78e6ee2c49611c00",
      rating: 1, 
      content: "Great Hotel",
      customerId: "6259f7dc78e6ee2c49611c04" 
    },
    {
      _id: "6259f7dc78e6ee2c49611c01",
      rating: 3.5, 
      content: "Great Hotel",
      customerId: "6259f7dc78e6ee2c49611c04"
    }
  ]
}

I would try something like:

  1. $unwind reviews
  2. $lookup with localField:reviews.customerId and as:reviews.customer
  3. if using as:reviews.customer does not work you may need a $set with $mergeObject
  4. recreate the array using $group with $push accumulator.