Я нахожу решение:
leaves = await Leave.aggregate([
{
"$lookup": {
"from": "users",
"let": { "companyId": "$employe" },
"pipeline": [
{ "$match": { "$expr": { "$eq": ["$_id", "$$companyId"] } } },
{
"$lookup": {
"from": "companies",
"let": { "companyId": "$company" },
"pipeline": [
{ "$match": { "_id": new mongoose.Types.ObjectId(company_id),"$expr": { "$eq": ["$_id", "$$companyId"] } } }
],
"as": "companies"
}
},
{ "$unwind": "$companies" }
],
"as": "users"
}
},
{ "$unwind": "$users" }
])