For MongoDB, when using $lookup to query more than one collection, is it possible to get a values-only list for a field returned in the $lookup?
$lookup
Just use .dot notation with the name field
.dot
name
db.foo.aggregate([ { "$lookup": { "from": "bar", "localField": "name", "foreignField": "foo", "as": "bars" }}, { "$addFields": { "bars": "$bars.name" }} ])
MongoPlayground