'How return value not array with values using leftJoin in createQueryBuilder?
I have query where I have two left joins. So left join return me array with object, but I know that value which come from left join will be just one. So my question is can I make left join and if value will be found return not object but just value?
now I have series: [{id: 5}]
what I want to do series: 5 - just value
or if it possible return just true of false series: true
.createQueryBuilder('sr')
.select(['sr.id','sr.name', 'srv.id' 'ser.id'])
.distinct(true)
.leftJoin('sr.scoringRuleValues', 'srv')
.leftJoin('sr.series', 'ser', 'ser.scoringRuleId = sr.id') // this join I need to improve
.where('sr.valueId =:valueId',
.getMany();
Solution 1:[1]
You can use .getRawMany() to not return an array with object
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Chris Catignani |
