Обходного пути нет, кроме использования $ lookup
db.collection.aggregate([
{
$lookup: {
from: "country",
localField: "country",
foreignField: "_id",
as: "countries"
}
},
{
$lookup: {
from: "state",
localField: "state",
foreignField: "_id",
as: "states"
}
},
{
$lookup: {
from: "city",
localField: "city",
foreignField: "_id",
as: "cities"
}
},
{
$unwind: {
path: "$countries",
preserveNullAndEmptyArrays: true
}
},
{
$unwind: {
path: "$states",
preserveNullAndEmptyArrays: true
}
},
{
$unwind: {
path: "$cities",
preserveNullAndEmptyArrays: true
}
}
])