समाधान मिला। यह किसी की मदद कर सकता है।
$collection = Yii::$app->mongodb->getCollection('ServiceProvider');
$result = $collection->aggregate([
['$unwind' => '$PostCommentUserIDs'],
[
'$lookup' =>
[
'from' => 'Parents',
'localField' => 'PostCommentUserIDs',
'foreignField' => 'ID',
'as' => 'ParentDetails'
]
],
[
'$match' => [
'ParentDetails' => [ '$ne' => [] ]
]
]
]);