How to $lookup Component documents in custom $aggregate query?

Mongo Shell Query

db.places.aggregate([
          {
            $geoNear: {
              near: {
                type: "Point",
                coordinates: [61.4903, 21.7997],
              },
              distanceField: "dist.calculated",
              maxDistance: 300,
              spherical: true,
            },
          },
          {
            $lookup: {
              from: "upload_file",
              localField: "cover",
              foreignField: "_id",
              as: "cover",
            },
          },
           {
            $unwind: "$cover",
          },
          {
            $unwind: "$links",
          },
          {
            $lookup: {
              from: "link",
              localField: "links.ref",
              foreignField: "_id",
              as: "links",
            },
          },
         ])