After reviewing the mongoose documentation at https://mongoosejs.com/docs/populate.html, I have learned that populate, similar to $lookup, is used to resolve relationships with other collections.
MongoDB introduced the join-like $lookup aggregation operator in versions >= 3.2. However, Mongoose offers a more robust solution called populate(), which allows you to reference documents in different collections.
In your scenario, it seems like there is no need to establish a connection with another collection since you already have the desired data. You can utilize $project at the end of your pipeline aggregation to only retain the name field, as shown below:
{ $project: { name:1 } }
Please let me know if this explanation was helpful for you.
Edit :
Upon closer inspection, if you encounter the mentioned data result post-populate rather than post-aggregation, you can use the select
function to isolate your final field. Refer to this answer for more details
user: {
email: "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7e161914163e19131f1712501d1113">[email protected]</a>",
address:{},
name: "name"
}