{
definition: { type: mongoose.Types.ObjectId, ref: 'Definition' }
}
{
title: String,
likes: Number
}
Post.aggregate([
{
$lookup: {
from: 'definitions',
localField: 'definition',
foreignField: '_id',
as: 'definitions'
}
},
{
$match: {
'definitions.likes': { $gte: 10 }
}
}
])