I have a query that is working fine in mongo shell but I want to convert that query into ODM style but I did not find the conditional statement syntex. Below is my query
$this->createAggregationBuilder(Source::class)
->lookup(Translated::class)
->localField('id')
->foreignField('sourceId')
// pipele should be here
->alias('result')
->getAggregation()->getIterator()->toArray();
What will be the right syntax/code to add pipleline/let with $lookup.
Second question is that is there any way that we can run first Query directly without ODM style.
I have a query that is working fine in mongo shell but I want to convert that query into ODM style but I did not find the conditional statement syntex. Below is my query
and I tried this but unable to add the piplelne
What will be the right syntax/code to add pipleline/let with $lookup. Second question is that is there any way that we can run first Query directly without ODM style.